shahar1 opened a new pull request, #76125:
URL: https://github.com/apache/airflow/pull/76125

   airflowctl builds its HTTP client without a timeout, so httpx's 5-second 
default applies to every request. A busy API server can legitimately take 
longer to answer a PATCH or POST, for example the first `dags update` or `dags 
trigger` right after the scheduler picked up a run of the same Dag. Write 
requests are deliberately not retried after a timeout (they may already have 
been applied), so the CLI exits 1 with:
   
   ```
   Read timeout error: timed out
   Please check if the server is running and the API ready to accept calls.
   The PATCH request failed, but it may already have been applied on the server.
   ```
   
   This is what made `Airflow CTL integration tests with PROD image` fail on 
`test_airflowctl_commands[dags update]` in run 41184063822 (unrelated PR 
#76090), and it reproduces locally whenever the API server host is under load.
   
   Change: a 30-second read/write/pool timeout with the connect timeout kept at 
5 seconds, so an unreachable host still fails fast; tunable with 
`AIRFLOW_CLI_API_TIMEOUT` (seconds, same `_get_int_env` validation as the 
`AIRFLOW_CLI_API_RETRY_*` knobs; bad or empty values fall back to the default). 
Applied with `setdefault`, so a `timeout=` passed to `Client` explicitly still 
wins. Documented next to the retry variables in `cli-and-env-variables-ref.rst`.
   
   Tested: `uv run --project airflow-ctl pytest airflow-ctl/tests`: 712 passed 
(new: parametrised default/explicit timeout test, the explicit case being a 
precedence guard for `setdefault`; `AIRFLOW_CLI_API_TIMEOUT` set / empty / `0` 
/ `-5` / non-integer with the stderr warning asserted, via the same subprocess 
pattern as the retry-knob tests; all fail without the change). `prek run 
mypy-airflow-ctl --all-files` passes before and after.
   
   Backport to `airflow-ctl/v0-1-test` follows for 0.1.6 (the branch has the 
same `_get_int_env` helper and docs section).
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Fable 5.1, with Sonnet 5.5 and Opus 5.5 subagents)
   
   Generated-by: Claude Code (Fable 5.1) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


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

  • [PR] Stop airflowctl timing o... shahar1 (via GitHub) via commits

Reply via email to