HeartSaVioR commented on a change in pull request #25702: [SPARK-29001][CORE] 
Print events that take too long time to process
URL: https://github.com/apache/spark/pull/25702#discussion_r323007421
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/util/ListenerBus.scala
 ##########
 @@ -111,7 +118,10 @@ private[spark] trait ListenerBus[L <: AnyRef, E] extends 
Logging {
           logError(s"Listener ${Utils.getFormattedClassName(listener)} threw 
an exception", e)
       } finally {
         if (maybeTimerContext != null) {
-          maybeTimerContext.stop()
+          val elapsed = maybeTimerContext.stop()
+          if (logSlowEventEnabled && elapsed > logSlowEventThreshold) {
+            logError(s"Process of event ${event} took ${elapsed / 
1000000000d}s.")
 
 Review comment:
   My 2 cents, given it doesn't make things crash, warning might be better.
   And logging "which listener" is also important as the problematic one might 
not be specific event but might be specific listener. It could be a combination 
of (specific listener, specific event).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to