amoghrajesh commented on code in PR #66572:
URL: https://github.com/apache/airflow/pull/66572#discussion_r3263761329
##########
task-sdk/src/airflow/sdk/execution_time/supervisor.py:
##########
@@ -793,6 +793,33 @@ def handle_requests(self, log: FilteringBoundLogger) ->
Generator[None, _Request
),
request_id=request.id,
)
+ except Exception as e:
+ # Catch-all so a transient network error (httpx.ConnectError /
+ # httpx.TimeoutException) or any other non-ServerResponseError
+ # exception doesn't crash this generator and permanently break
+ # the IPC channel — the task subprocess would then get EOFError
+ # on every subsequent communication and the worker would be
+ # stuck. Surface the error to the task so it can decide how to
+ # react, log it loudly on the supervisor side, and keep the
+ # request loop alive.
+ log.exception(
+ "Unhandled exception while handling task request",
+ request_id=request.id,
+ exception_type=type(e).__name__,
+ )
Review Comment:
Yeah `exception_type` is probably redundant
##########
task-sdk/src/airflow/sdk/execution_time/supervisor.py:
##########
@@ -793,6 +793,33 @@ def handle_requests(self, log: FilteringBoundLogger) ->
Generator[None, _Request
),
request_id=request.id,
)
+ except Exception as e:
+ # Catch-all so a transient network error (httpx.ConnectError /
+ # httpx.TimeoutException) or any other non-ServerResponseError
+ # exception doesn't crash this generator and permanently break
+ # the IPC channel — the task subprocess would then get EOFError
+ # on every subsequent communication and the worker would be
+ # stuck. Surface the error to the task so it can decide how to
+ # react, log it loudly on the supervisor side, and keep the
+ # request loop alive.
Review Comment:
```suggestion
# Generic exception handling so a transient network error
(httpx.ConnectError /
# httpx.TimeoutException) or any other exception
# doesn't crash this generator and crash the IPC
communication between supervisor and task
```
shorter?
--
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]