This is an automated email from the ASF dual-hosted git repository.

imaxon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git

commit 33647b6519671b5074c158f822193ce2db41b7a0
Author: Michael Blow <[email protected]>
AuthorDate: Thu Apr 15 18:08:02 2021 -0400

    [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-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/11083
    Reviewed-by: Murtadha Hubail <[email protected]>
    Reviewed-by: Michael Blow <[email protected]>
    Integration-Tests: Jenkins <[email protected]>
    Tested-by: Michael Blow <[email protected]>
---
 .../src/main/java/org/apache/hyracks/util/ExitUtil.java             | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
 
b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
index abd9fda..f4c4183 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
@@ -103,9 +103,11 @@ public class ExitUtil {
 
     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,
-                        ThreadDumpUtil.takeDumpString());
+                LOGGER.log(logLevel, "Thread dump at halt: {}", 
ThreadDumpUtil.takeDumpString());
                 // try to give time for the log to be emitted...
                 LogManager.shutdown();
             });

Reply via email to