-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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-12486] Worker should kill the executors more forcefully if possible. #10438
Conversation
…sible. This patch updates the ExecutorRunner's terminate path to use the new java 8 API to terminate processes more forcefully if possible. If the executor is unhealthy, it would previously ignore the destroy() call. Presumably, the new java API was added to handle cases like this.
Test build #48212 has finished for PR 10438 at commit
|
destroyMethod.setAccessible(true) | ||
destroyMethod.invoke(process) | ||
} catch { | ||
case e: Exception => { |
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.
in general catch NonFatal, i.e.
case NonFatal(e) => process.destroy()
Looks good. |
} catch { | ||
case e: Exception => { | ||
process.destroy() | ||
} |
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.
this might end up swallowing useful exception messages. Maybe we should catch more narrowly
case NonFatal(e) =>
if (!e.isInstanceOf[NoSuchMethodException]) {
logWarning("Exception when attempting to kill process", e)
}
process.destroy()
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.
+1 for narrowly catching exceptions
Test build #48374 has finished for PR 10438 at commit
|
if (!e.isInstanceOf[NoSuchMethodException]) { | ||
logWarning("Exception when attempting to kill process", e) | ||
} else { | ||
process.destroy() |
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.
don't we want to best-effort destroy the process whether or not it's a NSME?
test this please |
Test build #48398 has finished for PR 10438 at commit
|
Test build #48522 has finished for PR 10438 at commit
|
test this please |
Test build #48624 has finished for PR 10438 at commit
|
Merging into master 1.6 |
…sible. This patch updates the ExecutorRunner's terminate path to use the new java 8 API to terminate processes more forcefully if possible. If the executor is unhealthy, it would previously ignore the destroy() call. Presumably, the new java API was added to handle cases like this. We could update the termination path in the future to use OS specific commands for older java versions. Author: Nong Li <[email protected]> Closes #10438 from nongli/spark-12486-executors. (cherry picked from commit 8f65939) Signed-off-by: Andrew Or <[email protected]>
This patch updates the ExecutorRunner's terminate path to use the new java 8 API
to terminate processes more forcefully if possible. If the executor is unhealthy,
it would previously ignore the destroy() call. Presumably, the new java API was
added to handle cases like this.
We could update the termination path in the future to use OS specific commands
for older java versions.