Search in sources :

Example 1 with SingularityPreJettyLifecycle

use of com.hubspot.singularity.managed.SingularityPreJettyLifecycle in project Singularity by HubSpot.

the class SingularityAbort method abort.

public void abort(AbortReason abortReason, Optional<Throwable> throwable) {
    if (!aborting.getAndSet(true)) {
        try {
            sendAbortNotification(abortReason, throwable);
            SingularityLifecycleManaged lifecycle = injector.getInstance(SingularityLifecycleManaged.class);
            SingularityPreJettyLifecycle preJettyLifecycle = injector.getInstance(SingularityPreJettyLifecycle.class);
            try {
                preJettyLifecycle.stop();
                lifecycle.stop();
            } catch (Throwable t) {
                LOG.error("While shutting down", t);
            }
            flushLogs();
        } finally {
            exit();
        }
    }
}
Also used : SingularityLifecycleManaged(com.hubspot.singularity.managed.SingularityLifecycleManaged) SingularityPreJettyLifecycle(com.hubspot.singularity.managed.SingularityPreJettyLifecycle)

Aggregations

SingularityLifecycleManaged (com.hubspot.singularity.managed.SingularityLifecycleManaged)1 SingularityPreJettyLifecycle (com.hubspot.singularity.managed.SingularityPreJettyLifecycle)1