Repository navigation
Conversation
ForVic
approved these changes
Oct 29, 2026
ForVic
left a comment
Contributor
There was a problem hiding this comment.
lgtm minor nit in the pr desc:
the quoted JDK output has prio=5, which only JDK 9+ prints, so “JDK 8” might be off (the part being fixed is the same in both).
Contributor
Author
|
@ForVic Good catch, thanks! Fixed the PR description — the quoted output is indeed the JDK 9+ format (only 9+ prints |
yew1eb
force-pushed
the
fix-thread-stack-trace-blocked-by-thread-id
branch
from
November 1, 2026 15:24
d3e9929 to
9a46118
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Fix
ThreadStackTrace.toStringto append (instead of discard)blockedByThreadId, and add the missing leading space beforeowned by, incommon/src/main/scala/org/apache/celeborn/common/util/ThreadUtils.scala.Before:
After:
Why are the changes needed?
blockedByThreadId.foreach(id => s" Id=$id")returns a String that is never consumed, so it is a no-op and the id of the blocking thread never reaches the thread dump. This defeats the purpose of the class, which is to locate threads that block each other. The output above matchesjava.lang.management.ThreadInfo.toString()on JDK 9+, verified against a real blocked thread:The same bug exists in Spark master (
core/src/main/scala/org/apache/spark/status/api/v1/api.scala:570); it was inherited when CELEBORN-1697 copied the class from Spark v3.5.1.Does this PR resolve a correctness bug?
Does this PR introduce any user-facing change?
The text thread dump (
/threadDumpand logs) now includes the id of the blocking thread and a space beforeowned by. The JSON endpoint/api/v1/thread_dumpis unchanged: it already mapsblockedByThreadIdexplicitly inApiV1BaseResource.How was this patch tested?
Verified against a real blocked thread pair: the text dump now prints
"blocked-thread" Id=30 BLOCKED on java.lang.Object@... owned by "holder-thread" Id=29, matchingjava.lang.management.ThreadInfo.toString(). ExistingUtilsSuite(34 tests, includinggetThreadDump) still passes.