Spenserrrr commented on code in PR #59892:
URL: https://github.com/apache/spark/pull/59892#discussion_r4417707549


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -5857,7 +5857,10 @@ object SQLConf {
   val PYTHON_UDF_DETAILED_TIMING_ENABLED =
     buildConf("spark.sql.execution.pythonUDF.detailedTiming.enabled")
       .internal()
-      .doc("When true, collect detailed timing metrics for supported Python 
UDFs.")
+      .doc("When true, collect detailed timing metrics for supported Python 
UDFs. " +
+        "With spark.python.udf.pipelined.enabled, phase timings can overlap 
and their sum " +
+        "does not represent elapsed time. Exclude reports with nonzero " +
+        "pythonNumPipelinedTasks from additive phase breakdowns.")

Review Comment:
   Initialization of the shared WorkerMetrics instance is protected by a lock, 
but individual metric updates aren’t.
   
   I just checked the current pipeline path, and I think the reader thread 
records input-read timing, and the main thread records handler and output 
timings, so they update different metric entries. Also, each thread accumulates 
its totals locally and updates them to different metric entries when the 
handler finishes, so we don’t currently have two threads adding to the same 
phase total.
   
   If later there are multiple threads or handlers updating the same metric 
entry, we would then need locks for those fields as well. Happy to add locks 
around them right now if you think it is necessary.



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