Repository navigation
Keep airflowctl stdout parseable when a request is retried or fails - #76347
Conversation
The API client logs "Server error" and the tenacity retry warning through structlog, which prints to stdout when nothing configures it. A single retried 5xx then puts two log lines in front of the `-o json` output, while the command still exits 0. The shared error handler also printed its messages to stdout. apache#76133 and apache#76134 moved the messages of a few commands to stderr, but these two paths are shared by every command.
|
Fork CI: green. CI for the latest commit passed in your fork. The pull request is ready for maintainer review. Pull requests from contributors run their CI in the contributor's own fork. GitHub Actions is free and has no minute limit on public forks, while the CI capacity of the Apache Software Foundation is shared by every ASF project and is finite. How this works: fork CI for external contributors. This comment was posted automatically by the fork CI monitor from templates drafted with an AI-assisted tool, so it may contain mistakes. An Apache Airflow maintainer, a real person, will review the pull request once its fork CI is green. Why the first pass is automated. |
shahar1
left a comment
There was a problem hiding this comment.
Moving the structlog output and the safe_call_command errors to stderr keeps -o json stdout parseable after a retried or failed request; the change is small, matches #76133 / #76134, and the new tests fail without it.
Smaller observations
- See inline comments on
airflow-ctl/src/airflowctl/__main__.py:35.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Airflow maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Airflow handles maintainer review:
Contributing guide.
Backport successfully created: airflow-ctl/v0-1-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
…st is retried or fails (#76347) (#76380) The API client logs "Server error" and the tenacity retry warning through structlog, which prints to stdout when nothing configures it. A single retried 5xx then puts two log lines in front of the `-o json` output, while the command still exits 0. The shared error handler also printed its messages to stdout. #76133 and #76134 moved the messages of a few commands to stderr, but these two paths are shared by every command. (cherry picked from commit 6f7cb34) Co-authored-by: Andrew Chang <[email protected]>
…st is retried or fails (apache#76347) (apache#76380) The API client logs "Server error" and the tenacity retry warning through structlog, which prints to stdout when nothing configures it. A single retried 5xx then puts two log lines in front of the `-o json` output, while the command still exits 0. The shared error handler also printed its messages to stdout. apache#76133 and apache#76134 moved the messages of a few commands to stderr, but these two paths are shared by every command. (cherry picked from commit 6f7cb34) Co-authored-by: Andrew Chang <[email protected]>
Why
The airflowctl API client logs
Server errorand the retry warning through structlog. airflowctl does not configure structlog, and by default structlog prints to stdout. If the server returns one 503 and then a 200,airflowctl pools list -o jsonexits 0, but stdout is not valid JSON.What
main()now sends structlog output to stderr.safe_call_commandnow prints its error messages to stderr too. This is the same change #76133 and #76134 made for a few commands.related: #76133, #76134
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5.5) following the guidelines