Skip to content

Commit

Permalink
fix potential TaskFailedListener's callback won't be called (#6612)
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 #6019 (comment)
  • Loading branch information
wbo4958 committed Jan 21, 2021
1 parent f8bb678 commit 9d2832a
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 9d2832a

Please sign in to comment.