Github user JoshRosen commented on a diff in the pull request: https://github.com/apache/spark/pull/4008#discussion_r22828138 --- Diff: core/src/main/java/org/apache/spark/TaskContext.java --- @@ -94,6 +94,14 @@ static void unset() { @Deprecated public abstract void addOnCompleteCallback(final Function0<Unit> f); + /** + * Add a callback function to be executed on task stop. + * This will be called when task is being killed. + * + * @param f Callback function. + */ + public abstract void addOnStopCallback(final Function1<String, Unit> f); --- End diff -- I think this name is potentially confusing, since users might get confused about the difference between "stop" and "completion". I'd prefer something like "onKill" to make it more obvious that this is only called for killed tasks. Also, what is the string argument that's passed in to the callback? Also, this seems similar to the deprecated `addOnCompleteCallback`. Maybe we should fold the new callback into `TaskCompletionListener` instead?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org