You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/12 09:43:43 UTC

[GitHub] [spark] packyan commented on a diff in pull request #39021: [SPARK-41483][CORE] Last metrics system report should have a timeout, avoid to lead shutdown hook timeout

packyan commented on code in PR #39021:
URL: https://github.com/apache/spark/pull/39021#discussion_r1045598309


##########
core/src/main/scala/org/apache/spark/SparkContext.scala:
##########
@@ -2136,7 +2138,10 @@ class SparkContext(config: SparkConf) extends Logging {
     }
     if (env != null) {
       Utils.tryLogNonFatalError {
-        env.metricsSystem.report()
+        val metricsReportFuture = Future {
+          env.metricsSystem.report()
+        } (SparkContext.executionContext)
+        ThreadUtils.awaitResult(metricsReportFuture, Duration.create("1s"))

Review Comment:
   I think 1 to 2 seconds is reasonable.  The last metrics report is not necessary, we must reserve enough time for the application master hook to unregister and clean up temporary files.
   
   What do you think?
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org