summaryrefslogtreecommitdiffstats
path: root/jdisc_core
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2019-10-01 06:33:27 +0000
committerArne Juul <arnej@yahoo-inc.com>2019-10-01 06:33:27 +0000
commit4a24ef8b8154353958acec2a4bc3ba0b0fa74ea4 (patch)
treeddbd5877339195a15efdf4f6a2415c22ed2d4b90 /jdisc_core
parentf2124a7dd46698ba64899fd9eb6a16af37c158d3 (diff)
setup signal catching before loading bundles
* We have seen many core dumps happening during class initialization (in JNI code) - this happens when the container gets a SIGTERM while initialization is still happening; the normal shutdown that is triggered in this case will unload shared libraries while they are still in use. To counteract this trap SIGTERM early, but don't process it until bundle loading is complete. The downside is that early shutdown will be delayed, in some cases for quite a long time.
Diffstat (limited to 'jdisc_core')
-rw-r--r--jdisc_core/src/main/java/com/yahoo/jdisc/core/StandaloneMain.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/core/StandaloneMain.java b/jdisc_core/src/main/java/com/yahoo/jdisc/core/StandaloneMain.java
index 770c59dec35..c24e583ea46 100644
--- a/jdisc_core/src/main/java/com/yahoo/jdisc/core/StandaloneMain.java
+++ b/jdisc_core/src/main/java/com/yahoo/jdisc/core/StandaloneMain.java
@@ -39,9 +39,9 @@ public class StandaloneMain {
// We're not logging at this point since the application is responsible
// for setting up logging.
System.out.println("debug\tInitializing application without privileges.");
+ setupSignalHandlers();
loader.init(bundleLocation, false);
loader.start();
- setupSignalHandlers();
waitForShutdown();
System.out.println("debug\tTrying to shutdown in a controlled manner.");
log.log(Level.INFO, "JDisc shutting down");