[SPARK-54861][CORE] Reset task thread name to IDLE_TASK_THREAD_NAME when task completes #53634
+3
−1
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?
This PR proposes to reset the task thread name to
Executor task idle worker#threadIdwhen 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 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:

After this change:
How was this patch tested?
Manually tested (verified by Spark UI).
Was this patch authored or co-authored using generative AI tooling?
No.