austinaviv opened a new pull request, #76132:
URL: https://github.com/apache/airflow/pull/76132
When airflowctl runs against an unreachable or firewalled API server, or
when the server connection pool is saturated, httpx raises ConnectTimeout or
PoolTimeout rather than ConnectError. Previously, the operation wrapper only
caught ConnectError and safe_call_command only caught ReadTimeout. As a result,
connection timeouts, pool timeouts, and write timeouts crashed airflowctl with
an unhandled Python traceback instead of exiting cleanly.
Changes:
* Catch httpx.ConnectTimeout in
_check_flag_and_exit_if_server_response_error and raise
AirflowCtlConnectionException("Connection timed out. Is the API server
running?"), matching connection refused handling.
* Catch httpx.TimeoutException and httpx.WriteError in safe_call_command to
print a clean error message and exit with status code 1.
* In _warn_if_write_may_have_applied, skip the ambiguous-write warning when
the error is ConnectError, ConnectTimeout, or PoolTimeout, because requests
that never connected to the server could not have been applied.
* Add unit tests covering connection timeouts in operations and
timeout/protocol error handling in safe_call_command.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes
--
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]