Skip to content
Browse files
[NO ISSUE][HYR][MISC] Clear interrupted state on halt
Clear the calling thread's interrupted state on halt, to enable collection of
thread dump at exit. Should the thread be interrupted again before the thread
dump has completed, the collection will be aborted and the halt will proceed.

Change-Id: I29584c059bdae32baff67ba6f6d435cc8458b107
Reviewed-by: Murtadha Hubail <>
Reviewed-by: Michael Blow <>
Integration-Tests: Jenkins <>
Tested-by: Michael Blow <>
  • Loading branch information
mblow committed Apr 15, 2021
1 parent 94b1306 commit 33647b6519671b5074c158f822193ce2db41b7a0
Showing 1 changed file with 4 additions and 2 deletions.
@@ -103,9 +103,11 @@ public static void halt(int status) {

public static synchronized void halt(int status, Level logLevel) {
try {
boolean interrupted = Thread.interrupted();
LOGGER.log(logLevel, "JVM halting with status {} (halting thread {}, interrupted {})", status,
Thread.currentThread(), interrupted);
Future<?> future = haltThreadDumpExecutor.submit(() -> {
LOGGER.log(logLevel, "JVM halting with status {}; thread dump at halt: {}", status,
LOGGER.log(logLevel, "Thread dump at halt: {}", ThreadDumpUtil.takeDumpString());
// try to give time for the log to be emitted...

0 comments on commit 33647b6

Please sign in to comment.