Spenserrrr commented on code in PR #59976:
URL: https://github.com/apache/spark/pull/59976#discussion_r4518439324
##########
core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:
##########
@@ -1206,6 +1207,7 @@ private[spark] abstract class BasePythonRunner[IN, OUT](
s"Expected the Python worker init response, but got $other")
}
} catch handleException
+ initResponseTimeMs = System.currentTimeMillis()
Review Comment:
Fixed by isolating init reads: default mode reads the response before
producing rows, and pipelined mode completes init on the task thread before
starting the row writer. The JVM timestamp is captured before row production;
real-socket regressions cover both modes.
Generated-by: Codex (GPT-6)
##########
python/pyspark/worker.py:
##########
@@ -111,6 +111,8 @@ def report_init_response(
payload = json.dumps(response, separators=(",", ":")).encode("utf-8")
write_int(SpecialLengths.START_OF_INIT_RESPONSE, outfile)
write_with_length(payload, outfile)
+ # The JVM timestamps this response to measure initialization.
+ outfile.flush()
Review Comment:
I reproduced the socket-model stall, but saw none with the init-only default
reader in the tested Spark workloads (Linux, reused TCP workers, classic scalar
UDFs). Keeping the flush without changing socket options.
Generated-by: Codex (GPT-6)
--
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]