ueshin commented on code in PR #53055:
URL: https://github.com/apache/spark/pull/53055#discussion_r2525669820


##########
python/pyspark/daemon.py:
##########
@@ -85,7 +86,12 @@ def worker(sock, authenticated):
         try:
             outfile.flush()
         except Exception:
-            pass
+            faulthandler_log_path = os.environ.get("PYTHON_FAULTHANDLER_DIR", 
None)
+            if faulthandler_log_path:
+                faulthandler_log_path = os.path.join(faulthandler_log_path, 
str(os.getpid()))
+                with open(faulthandler_log_path, "w") as faulthandler_log_file:
+                    faulthandler.dump_traceback(file=faulthandler_log_file)
+            raise

Review Comment:
   Yes, it's intentional.
   If it returns some exit code (!=0), it waits for Java to send kind of "ACK" 
command for graceful shutdown, which is part of the protocol, but Java is still 
waiting for the reply from Python, so it won't recover anyway.
   I don't think it can recover in this case as something wrong should be 
already happening on the connection.
   
   
https://github.com/apache/spark/blob/97eec3f41438932a8e3fb4f81c4c8bb916e6cfdd/python/pyspark/daemon.py#L229-L236



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