-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-39601][YARN] AllocationFailure should not be treated as exitCausedByApp when driver is shutting down #38622
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,6 +199,8 @@ private[yarn] class YarnAllocator( | |
| } | ||
| } | ||
|
|
||
| @volatile private var shutdown = false | ||
|
|
||
| // The default profile is always present so we need to initialize the datastructures keyed by | ||
| // ResourceProfile id to ensure its present if things start running before a request for | ||
| // executors could add it. This approach is easier then going and special casing everywhere. | ||
|
|
@@ -215,6 +217,8 @@ private[yarn] class YarnAllocator( | |
|
|
||
| initDefaultProfile() | ||
|
|
||
| def setShutdown(shutdown: Boolean): Unit = this.shutdown = shutdown | ||
|
|
||
| def getNumExecutorsRunning: Int = synchronized { | ||
| runningExecutorsPerResourceProfileId.values.map(_.size).sum | ||
| } | ||
|
|
@@ -835,6 +839,8 @@ private[yarn] class YarnAllocator( | |
| // now I think its ok as none of the containers are expected to exit. | ||
| val exitStatus = completedContainer.getExitStatus | ||
| val (exitCausedByApp, containerExitReason) = exitStatus match { | ||
| case _ if shutdown => | ||
| (false, s"Executor for container $containerId exited after Application shutdown.") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ignore all executor exit after Spark shutdown. |
||
| case ContainerExitStatus.SUCCESS => | ||
| (false, s"Executor for container $containerId exited because of a YARN event (e.g., " + | ||
| "preemption) and not because of an error in the running job.") | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,10 @@ private[spark] class YarnClusterSchedulerBackend( | |
| startBindings() | ||
| } | ||
|
|
||
| override def stop(exitCode: Int): Unit = { | ||
| yarnSchedulerEndpoint.signalDriverStop(exitCode) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tgravescs I just notice super.stop is missed here, opened #39053 for that. |
||
| } | ||
|
|
||
| override def getDriverLogUrls: Option[Map[String, String]] = { | ||
| YarnContainerInfoHelper.getLogUrls(sc.hadoopConfiguration, container = None) | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
so maybe I'm missing a call but it looks like this Shutdown message is only sent in Client mode. Is that the only time you are seeing this issue? ie when you have the driver is local and the applicationmaster and yarn allocator are on the cluster?
But the log message in the description has YarnClusterSchedulerBackend which makes me think this is cluster mode.
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.
Yea, I just noticed that, do you think it's a good idea to send
Shutdownin cluster mode as well? or any other suggestions? cc @AngersZhuuuu as you are the author of that code.You are right, my reported job failed in cluster mode, and I think both yarn client/cluster modes have this issue.
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.
yeah this won't fix your issue as is so we would need something for cluster mode. I'm fine with sending the shutdown message. It would be nice if you could test the fix on your use case to make sure it fixes it as well.
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's ok to send
Shutdownin cluster mode too, not only for client mode.