bogao007 commented on code in PR #42986:
URL: https://github.com/apache/spark/pull/42986#discussion_r1329356792


##########
python/pyspark/sql/connect/streaming/worker/listener_worker.py:
##########
@@ -83,7 +86,14 @@ def process(listener_event_str, listener_event_type):  # 
type: ignore[no-untyped
     while True:
         event = utf8_deserializer.loads(infile)
         event_type = read_int(infile)
-        process(event, int(event_type))  # TODO(SPARK-44463): Propagate error 
to the user.
+        # Handle errors inside Python worker. Write 0 to outfile if no errors 
and write -2 with
+        # traceback string if error occurs.
+        try:
+            process(event, int(event_type))
+            write_int(0, outfile)

Review Comment:
   I think that's the only way to propagate something out of the Python worker, 
if it fails, then I'm not sure if there's anything else that could propagate 
that error out.
   
   From the [existing 
worker](https://github.com/apache/spark/blob/981312284f0776ca847c8d21411f74a72c639b22/python/pyspark/sql/worker/analyze_udtf.py#L161-L163),
 it does not do anything if there's an IOException but close the python 
process. But let me update the code to use the same way they did, which should 
be slightly better.



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to