You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "warrenzhu25 (via GitHub)" <gi...@apache.org> on 2023/05/07 05:36:35 UTC

[GitHub] [spark] warrenzhu25 opened a new pull request, #41077: [SPARK-43397][CORE] Log executor decommission duration

warrenzhu25 opened a new pull request, #41077:
URL: https://github.com/apache/spark/pull/41077

   ### What changes were proposed in this pull request?
   Log executor decommission duration
   
   ### Why are the changes needed?
   Executor decommission duration is important info to understand resource efficiency and troubleshoot decommission issue. 
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   Manually tested.
   


-- 
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


[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #41077: [SPARK-43397][CORE] Log executor decommission duration

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #41077:
URL: https://github.com/apache/spark/pull/41077#discussion_r1186909802


##########
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala:
##########
@@ -1086,11 +1086,18 @@ private[spark] class TaskSchedulerImpl(
     case ExecutorKilled =>
       logInfo(s"Executor $executorId on $hostPort killed by driver.")
     case _: ExecutorDecommission =>
-      logInfo(s"Executor $executorId on $hostPort is decommissioned.")
+      logInfo(s"Executor $executorId on $hostPort is decommissioned after " +
+        s"${Utils.msDurationToString(getDecommissionDurationMs(executorId))}.")
     case _ =>
       logError(s"Lost executor $executorId on $hostPort: $reason")
   }
 
+  private def getDecommissionDurationMs(executorId: String): Long = {
+    executorsPendingDecommission.get(executorId)
+      .map(s => clock.getTimeMillis() - s.startTime)
+      .getOrElse(0L)

Review Comment:
   Could you add a function description. Especially, describing about what is the meaning of `0L` when `executorsPendingDecommission.get` doesn't exist.



##########
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala:
##########
@@ -1086,11 +1086,18 @@ private[spark] class TaskSchedulerImpl(
     case ExecutorKilled =>
       logInfo(s"Executor $executorId on $hostPort killed by driver.")
     case _: ExecutorDecommission =>
-      logInfo(s"Executor $executorId on $hostPort is decommissioned.")
+      logInfo(s"Executor $executorId on $hostPort is decommissioned after " +
+        s"${Utils.msDurationToString(getDecommissionDurationMs(executorId))}.")
     case _ =>
       logError(s"Lost executor $executorId on $hostPort: $reason")
   }
 
+  private def getDecommissionDurationMs(executorId: String): Long = {
+    executorsPendingDecommission.get(executorId)
+      .map(s => clock.getTimeMillis() - s.startTime)
+      .getOrElse(0L)

Review Comment:
   Could you add a function description? Especially, describing about what is the meaning of `0L` when `executorsPendingDecommission.get` doesn't exist.



-- 
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


[GitHub] [spark] warrenzhu25 commented on pull request #41077: [SPARK-43397][CORE] Log executor decommission duration

Posted by "warrenzhu25 (via GitHub)" <gi...@apache.org>.
warrenzhu25 commented on PR #41077:
URL: https://github.com/apache/spark/pull/41077#issuecomment-1537295989

   @dongjoon-hyun helpt take a look?


-- 
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


[GitHub] [spark] pan3793 commented on a diff in pull request #41077: [SPARK-43397][CORE] Log executor decommission duration

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #41077:
URL: https://github.com/apache/spark/pull/41077#discussion_r1186822944


##########
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala:
##########
@@ -1086,11 +1086,18 @@ private[spark] class TaskSchedulerImpl(
     case ExecutorKilled =>
       logInfo(s"Executor $executorId on $hostPort killed by driver.")
     case _: ExecutorDecommission =>
-      logInfo(s"Executor $executorId on $hostPort is decommissioned.")
+      logInfo(s"Executor $executorId on $hostPort is decommissioned after " +
+        s"${getDecommissionDurationMs(executorId)} ms.")

Review Comment:
   Please use `Utils.msDurationToString` to generate a more human-readable string representing a duration



-- 
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


[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #41077: [SPARK-43397][CORE] Log executor decommission duration

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #41077:
URL: https://github.com/apache/spark/pull/41077#discussion_r1187681984


##########
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala:
##########
@@ -1086,11 +1086,19 @@ private[spark] class TaskSchedulerImpl(
     case ExecutorKilled =>
       logInfo(s"Executor $executorId on $hostPort killed by driver.")
     case _: ExecutorDecommission =>
-      logInfo(s"Executor $executorId on $hostPort is decommissioned.")
+      logInfo(s"Executor $executorId on $hostPort is decommissioned after " +
+        s"${getDecommissionDuration(executorId)}.")
     case _ =>
       logError(s"Lost executor $executorId on $hostPort: $reason")
   }
 
+  // return decommission duration in string or "unknown time" if decommission startTime not exists
+  private def getDecommissionDuration(executorId: String): String = {
+    executorsPendingDecommission.get(executorId)
+      .map(s => Utils.msDurationToString(clock.getTimeMillis() - s.startTime))
+      .getOrElse("unknown time")

Review Comment:
   So, the log message goes with `... is decommissioned after unknown time`?



-- 
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


[GitHub] [spark] dongjoon-hyun commented on pull request #41077: [SPARK-43397][CORE] Log executor decommission duration in `executorLost` method

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #41077:
URL: https://github.com/apache/spark/pull/41077#issuecomment-1539247388

   Merged to master for Apache Spark 3.5.0.
   Thank you, @warrenzhu25 .


-- 
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


[GitHub] [spark] dongjoon-hyun closed pull request #41077: [SPARK-43397][CORE] Log executor decommission duration in `executorLost` method

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #41077: [SPARK-43397][CORE] Log executor decommission duration in `executorLost` method
URL: https://github.com/apache/spark/pull/41077


-- 
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


[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #41077: [SPARK-43397][CORE] Log executor decommission duration

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #41077:
URL: https://github.com/apache/spark/pull/41077#discussion_r1187692239


##########
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala:
##########
@@ -1086,11 +1086,19 @@ private[spark] class TaskSchedulerImpl(
     case ExecutorKilled =>
       logInfo(s"Executor $executorId on $hostPort killed by driver.")
     case _: ExecutorDecommission =>
-      logInfo(s"Executor $executorId on $hostPort is decommissioned.")
+      logInfo(s"Executor $executorId on $hostPort is decommissioned after " +
+        s"${getDecommissionDuration(executorId)}.")
     case _ =>
       logError(s"Lost executor $executorId on $hostPort: $reason")
   }
 
+  // return decommission duration in string or "unknown time" if decommission startTime not exists
+  private def getDecommissionDuration(executorId: String): String = {
+    executorsPendingDecommission.get(executorId)
+      .map(s => Utils.msDurationToString(clock.getTimeMillis() - s.startTime))
+      .getOrElse("unknown time")

Review Comment:
   This could give a not-good impression to the users because it's interpreted as a Spark bug by the users. Can we give more informative message to avoid that? Or, can we keep the original message in this case?
   
   For example,
   - When we know the time, `Executor $executorId on $hostPort is decommissioned after ...`
   - When we don't know, `Executor $executorId on $hostPort is decommissioned.` (the same message like before)



-- 
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