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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-50648][CORE] when the job is cancelled during shuffle retry in parent stage, might leave behind zombie running tasks #49270
base: master
Are you sure you want to change the base?
[SPARK-50648][CORE] when the job is cancelled during shuffle retry in parent stage, might leave behind zombie running tasks #49270
Changes from 3 commits
893fe64
a820cad
1bcd4b6
7fb4bc1
9a58f60
bc33ffb
4e0fd2f
c589fe8
8ebd0b1
85c7c02
d2822ed
a37c667
85a3577
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we check the
failedAttemptIds
instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can Please see this
I'm not sure which way is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like @Ngone51's suggestion better - simply check for
stage.failedAttemptIds.nonEmpty || runningStages.contains(stage)
.I can see an argument being made for failed as well.
With this, the PR will boil down to this change and tests to stress this logic ofcourse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mridulm @Ngone51 do you think it is necessary
(waitingStages.contains(stage) && stage.failedAttemptIds.nonEmpty) || runningStages.contains(stage)
. Only consideringfailedAttemptIds
may result in repeated calls to the the stage already completed and failed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there could be a case where the stage exists in
failedStages
but not inwaitingStages
, e.g., in the case of fetch failures, map stage and reduce stage can be added intofailedStages
, but the related job could be canceled before they were resubmitted. So addingwaitingStages.contains(stage)
would miss the stages infailedStages
. And I don't think we would have repeated calls as we don't kill tasks for those failed stages.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the confirmation, done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this method ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see this
This is the code I wrote at the beginning (kill waiting stage which only has running tasks).
I'm not sure which way is better and I will delete this if we choose one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the method is no longer being used, please remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last one added is the resubmit stage (FetchFailed) and in waiting stages. We will kill it and one more SparkListenerStageCompleted event will be added ( see markStageAsFinished)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After changing to judging by
failedAttemptIds
, it won't cancel. Because all tasks finished already , inmarkStageAsFinished
will removefailedAttemptIds
if no error message.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yabola I'm curious about the difference here. With the current approach, doesn't the stage still has to be killed because of
failedAttemptIds.nonEmpty
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me explain the timeline of the last event in this UT:
handleTaskCompletion
, the result stagemarkStageAsFinished
and clean result stage'sfailedAttemptIds
cancelRunningIndependentStages
cancel map stage (it is in running stage) . Result stage is waiting , but don't havefailedAttemptIds
, so it won't be killed (and also no running tasks in result stage)In this UT, it is really no need to kill the last result stage.