Skip to content

Commit

Permalink
Log Blocked IO Thread State (#43424)
Browse files Browse the repository at this point in the history
* Let's log the state of the thread to find out if it's dead-locked or just stuck after being suspended
* Relates #43392
  • Loading branch information
original-brownbear authored Jun 20, 2019
1 parent 19c253c commit 0b48f04
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ private void logLongRunningExecutions() {
final long elapsedTimeInNanos = threadPool.relativeTimeInNanos() - entry.getValue();
if (elapsedTimeInNanos > warnThreshold) {
final Thread thread = entry.getKey();
logger.warn("Potentially blocked execution on network thread [{}] [{} milliseconds]: \n{}", thread.getName(),
logger.warn("Potentially blocked execution on network thread [{}] [{}] [{} milliseconds]: \n{}",
thread.getName(),
thread.getState(),
TimeUnit.NANOSECONDS.toMillis(elapsedTimeInNanos),
Arrays.stream(thread.getStackTrace()).map(Object::toString).collect(Collectors.joining("\n")));
}
Expand Down

0 comments on commit 0b48f04

Please sign in to comment.