Skip to content

Commit

Permalink
[SPARK-45086][UI] Display hexadecimal for thread lock hash code
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

This PR fixes the stringify method for MonitorInfo/LockInfo to use `toString` which contains an extra step of Integer.toHexString.

### Why are the changes needed?

to be consistent with the lock-holder

### Does this PR introduce _any_ user-facing change?

yes, UI and the response for the rest API(/applications/[app-id]/executors/[executor-id]/threads) change

### How was this patch tested?

verified locally

### Was this patch authored or co-authored using generative AI tooling?

no

Closes #42826 from yaooqinn/SPARK-45086.

Authored-by: Kent Yao <[email protected]>
Signed-off-by: Kent Yao <[email protected]>
  • Loading branch information
yaooqinn committed Sep 7, 2023
1 parent 622bbf2 commit 7818f47
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2108,10 +2108,8 @@ private[spark] object Utils
private implicit class Lock(lock: LockInfo) {
def lockString: String = {
lock match {
case monitor: MonitorInfo =>
s"Monitor(${lock.getClassName}@${monitor.getIdentityHashCode})"
case _ =>
s"Lock(${lock.getClassName}@${lock.getIdentityHashCode})"
case monitor: MonitorInfo => s"Monitor(${monitor.toString})"
case _ => s"Lock(${lock.toString})"
}
}
}
Expand Down

0 comments on commit 7818f47

Please sign in to comment.