anblanco opened a new pull request, #55224: URL: https://github.com/apache/spark/pull/55224
## Summary Backport of SPARK-53759 fix to branch-4.0. On Python 3.12+, changed GC finalization ordering can close the underlying socket before `BufferedRWPair` flushes its write buffer, causing `EOFException` on the JVM side. This affects the simple-worker (non-daemon) path used on Windows and when `spark.python.use.daemon=false`. Adds explicit `sock_file.close()` in a finally block to all 12 worker files' `__main__` blocks, matching how PR #54458 solved this on master via a context manager. Regression tests are in a separate PR targeting master: #55223. ## Test plan - [x] Red/green verified in local WSL build (Python 3.12.3): unfixed build fails with EOFException, fixed build passes 11/11 SimpleWorkerTests -- 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]
