Log Blocked IO Thread State (#43424) (#43447)

* Let's log the state of the thread to find out if it's dead-locked or just stuck after being suspended
* Relates #43392
This commit is contained in:
Armin Braun 2019-06-20 22:31:36 +02:00 committed by GitHub
parent 6b1e45b5b3
commit 1053a89b79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -373,7 +373,9 @@ public class MockNioTransport extends TcpTransport {
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")));
}