Github user jsoltren commented on a diff in the pull request:
https://github.com/apache/spark/pull/18594#discussion_r128871196
--- Diff: core/src/main/scala/org/apache/spark/executor/Executor.scala ---
@@ -473,29 +473,36 @@ private[spark] class Executor(
// the default uncaught exception handler, which will terminate
the Executor.
logError(s"Exception in $taskName (TID $taskId)", t)
- // Collect latest accumulator values to report back to the driver
- val accums: Seq[AccumulatorV2[_, _]] =
- if (task != null) {
- task.metrics.setExecutorRunTime(System.currentTimeMillis() -
taskStart)
- task.metrics.setJvmGCTime(computeTotalGcTime() - startGCTime)
- task.collectAccumulatorUpdates(taskFailed = true)
- } else {
- Seq.empty
- }
+ // SPARK-20904: Do not report failure to driver if if happened
during shut down. Because
+ // libraries may set up shutdown hooks that race with running
tasks during shutdown,
+ // spurious failures may occur and can result in improper
accounting in the driver (e.g.
+ // the task failure would not be ignored if the shutdown
happened because of premption,
+ // instead of an app issue).
+ if (!ShutdownHookManager.inShutdown()) {
--- End diff --
At this point I don't think we have any information on why we're in
shutdown, whether it is an app issue, the Spark executor process being killed
from the command line, etc.
Yes, a nice log message would be nice. Maybe, in the else clause to this
if, something like logInfo(s"Not reporting failure as we are in the middle of a
shutdown").
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]