[SPARK-32600][CORE] Unify task name in some logs between driver and executor #29418
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 replaces some arbitrary task names in logs with the widely used task name (e.g. "task 0.0 in stage 1.0 (TID 1)") among driver and executor. This will change the task name in
TaskDescriptionby appending TID.Why are the changes needed?
Some logs are still using TID(a.k.a
taskId) only as the task name, e.g.,spark/core/src/main/scala/org/apache/spark/executor/Executor.scala
Line 786 in 7f275ee
spark/core/src/main/scala/org/apache/spark/executor/Executor.scala
Lines 632 to 635 in 7f275ee
And the task thread name also only has the
taskId:spark/core/src/main/scala/org/apache/spark/executor/Executor.scala
Line 325 in 7f275ee
As mentioned in #1259, TID itself does not capture stage or retries, making it harder to correlate with the application. It's inconvenient when debugging applications.
Actually, task name like "task name (e.g. "task 0.0 in stage 1.0 (TID 1)")" has already been used widely after #1259. We'd better follow the naming convention.
Does this PR introduce any user-facing change?
Yes. Users will see the more consistent task names in the log.
How was this patch tested?
Manually checked.