Commit 2c5b4b0
committed
[SPARK-54861][CORE] Reset task thread name to IDLE_TASK_THREAD_NAME when task completes
### What changes were proposed in this pull request?
This PR proposes to reset the task thread name to `Executor task idle worker#threadId` when a task completes.
### Why are the changes needed?
This change provides better observablity for users and developers. Currently, when a task completes, the [task thread name](https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/executor/Executor.scala#L642) remains unchanged until a new task launched overrides the original name. Therefore, we can still see the specific task name from the task thread stacktrace even if the task has been completed. And this is misleading as people may mistakenly think that the task thread is actively running for some task but is idle indeed.
### Does this PR introduce _any_ user-facing change?
Yes. Users see different thread name from the executor thread dump page.
Before this change:
<img width="1554" height="492" alt="image (6)" src="https://github.com/user-attachments/assets/eba7bb8c-652d-4aa4-9b58-a8748f89ee7e" />
After this change:
<img width="1560" height="516" alt="image (7)" src="https://github.com/user-attachments/assets/964cfbda-11af-4e96-a492-16eb1d0ec6ab" />
### How was this patch tested?
Manually tested (verified by Spark UI).
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #53634 from Ngone51/unset-task-thread-name.
Authored-by: Yi Wu <[email protected]>
Signed-off-by: Yi Wu <[email protected]>1 parent ea8e941 commit 2c5b4b0
1 file changed
+3
-1
lines changedLines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
| 947 | + | |
947 | 948 | | |
948 | 949 | | |
949 | 950 | | |
| |||
1388 | 1389 | | |
1389 | 1390 | | |
1390 | 1391 | | |
| 1392 | + | |
1391 | 1393 | | |
1392 | 1394 | | |
1393 | 1395 | | |
| |||
0 commit comments