holdenk commented on code in PR #52931:
URL: https://github.com/apache/spark/pull/52931#discussion_r2535116634


##########
core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:
##########
@@ -259,6 +267,10 @@ private[spark] abstract class BasePythonRunner[IN, OUT](
     val startTime = System.currentTimeMillis
     val env = SparkEnv.get
 
+    // Log task context information at the start of computation
+    logInfo(s"Starting Python task execution (Stage ${context.stageId()}, " +

Review Comment:
   This seems to repeat some of information in `taskIdentifier` (e.g. attempt 
number and stage id) in many places where there's a new `logInfo` added. Can 
you double check the log messages that are generated don't have duplicate info?



##########
core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:
##########
@@ -811,16 +835,13 @@ private[spark] abstract class BasePythonRunner[IN, OUT](
               pythonWorkerStatusMessageWithContext(handle, worker, hasInput || 
buffer.hasRemaining))
           } else {
             logWarning(
-              log"Idle timeout reached for Python worker (timeout: " +
-              log"${MDC(LogKeys.PYTHON_WORKER_IDLE_TIMEOUT, 
idleTimeoutSeconds)} seconds). " +
-              log"No data received from the worker process: " +
-              pythonWorkerStatusMessageWithContext(handle, worker, hasInput || 
buffer.hasRemaining))
+              s"Idle timeout reached for Python worker (timeout: 
$idleTimeoutSeconds seconds). " +
+              s"No data received from the worker process - 
${taskIdentifier(context)}")

Review Comment:
   Why switching from log w/the MDC to raw format strings?



##########
core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:
##########
@@ -620,10 +636,18 @@ private[spark] abstract class BasePythonRunner[IN, OUT](
       val init = initTime - bootTime
       val finish = finishTime - initTime
       val total = finishTime - startTime
-      logInfo(log"Times: total = ${MDC(LogKeys.TOTAL_TIME, total)}, " +
-        log"boot = ${MDC(LogKeys.BOOT_TIME, boot)}, " +
-        log"init = ${MDC(LogKeys.INIT_TIME, init)}, " +
-        log"finish = ${MDC(LogKeys.FINISH_TIME, finish)}")
+
+      // Format data size for readability
+      val dataKB = totalDataReceived / 1024.0
+      val dataMB = dataKB / 1024.0
+      val dataStr = if (dataMB >= 1.0) {
+        f"$dataMB%.2f MB"
+      } else {
+        f"$dataKB%.2f KB"
+      }
+
+      logInfo(s"Times: total = $total, boot = $boot, init = $init, finish = 
$finish - " +

Review Comment:
   some question re: mdc + log v.s. raw s strings



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to