aboutsummaryrefslogtreecommitdiffstats
path: root/container-disc
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-09-09 16:44:17 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-09-09 16:44:17 +0200
commitfc5ad1abc980bd5bec570ace8b6ac4fe68c8b816 (patch)
tree56bbc745bff03be2dbc6b1a6b55b373149d51402 /container-disc
parent557c942a6cfee933140eef893889e2218897b26c (diff)
Terminate jvm on Error during reconfiguration
This avoids entering a zombie state due to a destructive reconfiguration attempt. LinkageError is exempted as that is a normal consequence of OSGi loading problems.
Diffstat (limited to 'container-disc')
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java b/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java
index 7dcbdfa251b..e602813c263 100644
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java
+++ b/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java
@@ -158,17 +158,20 @@ public final class ConfiguredApplication implements Application {
private void startReconfigurerThread() {
reconfigurerThread = new Thread(() -> {
- while (!Thread.interrupted()) {
+ while ( ! Thread.interrupted()) {
try {
ContainerBuilder builder = createBuilderWithGuiceBindings();
configurer.runOnceAndEnsureRegistryHackRun(builder.guiceModules().activate());
intitializeAndActivateContainer(builder);
} catch (ConfigInterruptedException | InterruptedException e) {
break;
- } catch (Exception e) {
+ } catch (Exception | LinkageError e) { // LinkageError: OSGi problems
log.log(Level.SEVERE,
"Reconfiguration failed, your application package must be fixed, unless this is a " +
"JNI reload issue: " + Exceptions.toMessageString(e), e);
+ } catch (Error e) {
+ com.yahoo.protect.Process.logAndDie("java.lang.Error on reconfiguration: We are probably in " +
+ "a bad state and will terminate", e);
}
}
log.fine("Shutting down HandlersConfigurerDi");