use of com.hubspot.singularity.runner.base.sentry.SingularityRunnerExceptionNotifier in project Singularity by HubSpot.
the class SingularityRunner method run.
@SuppressFBWarnings("DM_EXIT")
public void run(Iterable<? extends Module> modules) {
final Injector injector = Guice.createInjector(Stage.PRODUCTION, modules);
final SingularityRunnerExceptionNotifier exceptionNotifier = injector.getInstance(SingularityRunnerExceptionNotifier.class);
final SingularityDriver driver = injector.getInstance(SingularityDriver.class);
Runtime.getRuntime().addShutdownHook(new Thread("SingularityRunnerGracefulShutdown") {
@Override
public void run() {
driver.shutdown();
}
});
try {
driver.startAndWait();
LOG.info("Exiting normally");
System.exit(0);
} catch (MissingConfigException mce) {
LOG.error("Missing required configuration, exiting", mce);
System.exit(1);
} catch (Throwable t) {
LOG.error("Caught unexpected exception, exiting", t);
exceptionNotifier.notify(String.format("Unexpected exception in runner (%s)", t.getMessage()), t, Collections.<String, String>emptyMap());
System.exit(1);
}
}
use of com.hubspot.singularity.runner.base.sentry.SingularityRunnerExceptionNotifier in project Singularity by HubSpot.
the class ArtifactManagerTest method setup.
@Before
public void setup() {
SingularityRunnerBaseConfiguration baseConfig = new SingularityRunnerBaseConfiguration();
SingularityS3Configuration s3Config = new SingularityS3Configuration();
s3Config.setArtifactCacheDirectory(cacheDir.toString());
artifactManager = new ArtifactManager(baseConfig, s3Config, LoggerFactory.getLogger(ArtifactManagerTest.class), new SingularityRunnerExceptionNotifier(baseConfig));
}
Aggregations