Skip to content

Commit

Permalink
TESTS: More Logging in LongGcDisruptionTests
Browse files Browse the repository at this point in the history
* The existing logging is not helpful enough to track down which threads hang, we need the hanging thread's stacktraces too
* Relates elastic#35686
  • Loading branch information
original-brownbear committed Nov 19, 2018
1 parent 6d8af97 commit 848a598
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,14 @@ protected void doRun() throws Exception {
throw new RuntimeException("unknown error while suspending threads", suspendingError.get());
}
if (suspendingThread.isAlive()) {
logger.warn("failed to suspend node [{}]'s threads within [{}] millis. Suspending thread stack trace:\n {}"
, disruptedNode, getSuspendingTimeoutInMillis(), stackTrace(suspendingThread.getStackTrace()));
logger.warn(
"failed to suspend node [{}]'s threads within [{}] millis. Suspending thread stack trace:\n {}" +
"\nThreads that weren't suspended:\n {}"
, disruptedNode, getSuspendingTimeoutInMillis(), stackTrace(suspendingThread.getStackTrace()),
suspendedThreads.stream()
.map(t -> t.getName() + "\n----\n" + stackTrace(t.getStackTrace()))
.collect(Collectors.joining("\n"))
);
suspendingThread.interrupt(); // best effort;
try {
/*
Expand Down

0 comments on commit 848a598

Please sign in to comment.