Skip to content

Commit

Permalink
fix potential TaskFailedListener's callback won't be called
Browse files Browse the repository at this point in the history
there is possibility that onJobStart of TaskFailedListener won't be called, if
the job is submitted before the other thread adds addSparkListener.

detail can be found at dmlc#6019 (comment)
  • Loading branch information
wbo4958 committed Jan 18, 2021
1 parent d132933 commit 3c9f122
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -613,8 +613,12 @@ object XGBoost extends Serializable {
}
}
sparkJobThread.setUncaughtExceptionHandler(tracker)
sparkJobThread.start()
val trackerReturnVal = parallelismTracker.execute(tracker.waitFor(0L))

val trackerReturnVal = parallelismTracker.execute {
sparkJobThread.start()
tracker.waitFor(0L)
}

logger.info(s"Rabit returns with exit code $trackerReturnVal")
val (booster, metrics) = postTrackerReturnProcessing(trackerReturnVal,
boostersAndMetrics, sparkJobThread)
Expand Down

0 comments on commit 3c9f122

Please sign in to comment.