Add support for performing checks on Gerrit start up
This allows to do checks on Gerrit startup and abort the Gerrit startup if issues are found. E.g. this allows us to do validation on the Gerrit config, which is needed by a follow-up change. The startup checks are done after all lifecycle listeners have been invoked so that logging is already available and the reason for a failing startup can be written to the error log. All implementations of StartupCheck should be bound in StartupChecks.Module. Change-Id: I941dad2c926130a1f9c5a1a363f7e1eff0dab304 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -32,6 +32,7 @@ import com.google.gerrit.lucene.LuceneIndexModule;
|
||||
import com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker;
|
||||
import com.google.gerrit.pgm.util.LogFileCompressor;
|
||||
import com.google.gerrit.server.LibModuleLoader;
|
||||
import com.google.gerrit.server.StartupChecks;
|
||||
import com.google.gerrit.server.account.InternalAccountDirectory;
|
||||
import com.google.gerrit.server.cache.h2.DefaultCacheFactory;
|
||||
import com.google.gerrit.server.change.ChangeCleanupRunner;
|
||||
@@ -319,6 +320,7 @@ public class WebAppInitializer extends GuiceServletContextListener
|
||||
modules.add(new PluginRestApiModule());
|
||||
modules.add(new RestCacheAdminModule());
|
||||
modules.add(new GpgModule(config));
|
||||
modules.add(new StartupChecks.Module());
|
||||
|
||||
// Index module shutdown must happen before work queue shutdown, otherwise
|
||||
// work queue can get stuck waiting on index futures that will never return.
|
||||
|
Reference in New Issue
Block a user