You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "WweiL (via GitHub)" <gi...@apache.org> on 2023/09/18 22:20:21 UTC

[GitHub] [spark] WweiL commented on a diff in pull request #42986: [SPARK-44463][SS][CONNECT] Improve error handling for Connect steaming Python worker

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


##########
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:
   Do you think it's possible that the `read_` and `write_` method could throw exceptions?



-- 
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-unsubscribe@spark.apache.org

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


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