summaryrefslogtreecommitdiffstats
path: root/container-disc
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-03-01 11:26:38 +0100
committerJon Bratseth <bratseth@oath.com>2018-03-01 11:26:38 +0100
commit243312e4fba86ce26ac34a37dacc55c516ded0d8 (patch)
tree3718eeb58d1c08edd2ed5fc27710b900a941c7d3 /container-disc
parent9f348b96dbedeafe2a743eeb835d24339075e69a (diff)
Log before sleeping
Diffstat (limited to 'container-disc')
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/component/Deconstructor.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/component/Deconstructor.java b/container-disc/src/main/java/com/yahoo/container/jdisc/component/Deconstructor.java
index b103e485832..00fc62ff842 100644
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/component/Deconstructor.java
+++ b/container-disc/src/main/java/com/yahoo/container/jdisc/component/Deconstructor.java
@@ -6,6 +6,7 @@ import com.yahoo.concurrent.ThreadFactoryFactory;
import com.yahoo.container.di.ComponentDeconstructor;
import com.yahoo.container.di.componentgraph.Provider;
import com.yahoo.jdisc.SharedResource;
+import com.yahoo.log.LogLevel;
import java.security.SecureRandom;
import java.util.Random;
@@ -78,13 +79,15 @@ public class Deconstructor implements ComponentDeconstructor {
catch (Error e) {
try {
// Randomize restart over 10 minutes to avoid simultaneous cluster restarts
- Thread.sleep(random() * 1000 * 60 * 10);
+ long randomSleepSeconds = random() * 60 * 10;
+ log.log(LogLevel.FATAL, "Error when deconstructing " + component + " Will sleep for " +
+ randomSleepSeconds + " seconds then restart", e);
+ Thread.sleep(randomSleepSeconds * 1000);
}
catch (InterruptedException exception) {
log.log(WARNING, "Randomized wait before dying disrupted. Dying now.");
}
- com.yahoo.protect.Process.logAndDie("Shutting down due to error when deconstructing " +
- component, e);
+ com.yahoo.protect.Process.logAndDie("Shutting down due to error when deconstructing " + component);
}
catch (Throwable e) {
log.log(WARNING, "Non-error not exception throwable thrown when deconstructing " + component, e);