From 8fd7387bac3a178bffba3a72ac9bd0c96698a3e0 Mon Sep 17 00:00:00 2001 From: Sébastien Lesaint Date: Thu, 5 Sep 2019 12:37:09 +0200 Subject: threads should have unique names to ease debugging --- .../src/main/java/org/sonar/application/SchedulerImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/sonar-main/src/main/java/org/sonar/application/SchedulerImpl.java b/server/sonar-main/src/main/java/org/sonar/application/SchedulerImpl.java index abbd14efcbb..f55b6ed2e85 100644 --- a/server/sonar-main/src/main/java/org/sonar/application/SchedulerImpl.java +++ b/server/sonar-main/src/main/java/org/sonar/application/SchedulerImpl.java @@ -54,6 +54,8 @@ public class SchedulerImpl implements Scheduler, ManagedProcessEventListener, Pr private static final Logger LOG = LoggerFactory.getLogger(SchedulerImpl.class); private static final ManagedProcessHandler.Timeout HARD_STOP_TIMEOUT = newTimeout(1, TimeUnit.MINUTES); + private static int hardStopperThreadIndex = 0; + private static int restartStopperThreadIndex = 0; private final AppSettings settings; private final AppReloader appReloader; @@ -452,8 +454,9 @@ public class SchedulerImpl implements Scheduler, ManagedProcessEventListener, Pr } private class RestartStopperThread extends Thread { + private RestartStopperThread() { - super("Restart stopper"); + super("RestartStopper-" + restartStopperThreadIndex++); } @Override @@ -465,7 +468,7 @@ public class SchedulerImpl implements Scheduler, ManagedProcessEventListener, Pr private class HardStopperThread extends Thread { private HardStopperThread() { - super("Hard stopper"); + super("HardStopper-" + hardStopperThreadIndex++); } @Override -- cgit v1.2.3