-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-3469] Make sure all TaskCompletionListener are called even with failures #2343
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
Conversation
Note that this also changes the fault semantics of TaskCompletionListener. Previously failures in TaskCompletionListeners would result in the task being reported as failed. With this change, tasks won't be reported as failed simply because the execution of TaskCompletionListener fails.
Jenkins, add to whitelist. |
Jenkins, test this please. |
QA tests have started for PR 2343 at commit
|
QA tests have finished for PR 2343 at commit
|
QA tests have started for PR 2343 at commit
|
QA tests have started for PR 2343 at commit
|
QA tests have finished for PR 2343 at commit
|
QA tests have finished for PR 2343 at commit
|
Do we need to change the semantics though ? We could still save the first exception and return a task failure ? |
What do you think would be a good way to handle this? Perhaps throw back the first exception encountered? or throw an exception with all the error messages |
Ok I pushed a new version that creates a TaskCompletionListenerException that contains all the error messages. |
QA tests have started for PR 2343 at commit
|
QA tests have finished for PR 2343 at commit
|
@@ -77,6 +77,8 @@ class TaskContext( | |||
/** | |||
* Add a listener in the form of a Scala closure to be executed on task completion. | |||
* This will be called in all situation - success, failure, or cancellation. | |||
* Exceptions in callbacks are however not thrown back upstream, i.e. tasks won't marked as | |||
* failed even if completion callbacks fail to execute. |
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.
update this comment
I left a minor comment - Otherwise LGTM |
Jenkins, retest this please |
QA tests have started for PR 2343 at commit
|
QA tests have finished for PR 2343 at commit
|
Ok merging this in master. Thanks for taking a look. |
This is necessary because we rely on this callback interface to clean resources up. The old behavior would lead to resource leaks.
Note that this also changes the fault semantics of TaskCompletionListener. Previously failures in TaskCompletionListeners would result in the task being reported immediately. With this change, we report the exception at the end, and the reported exception is a TaskCompletionListenerException that contains all the exception messages.