Repository navigation
Conversation
Eason09053360
requested review from
bugraoz93,
dheerajturaga,
henry3260 and
potiuk
as code owners
September 8, 2026 03:21
Eason09053360
force-pushed
the
fix-jobs-check-allow-multiple-with-limit-zero
branch
2 times, most recently
from
September 8, 2026 12:51
e1a4eeb to
9e8895d
Compare
The guard rejected every limit at or below 1, but 0 is the documented value for disabling the limit: argparse accepts it, the flag's own help says "To disable limit, set 0", and the query builder already honours it. Operators running highly available schedulers were left guessing a magic upper bound instead of asking for every alive job, and the error message pointed them away from the value that would have worked. The successor command this one is deprecated in favour of, airflowctl jobs check, has accepted the combination since it was added, so the two CLIs disagreed about the same flag.
Eason09053360
force-pushed
the
fix-jobs-check-allow-multiple-with-limit-zero
branch
from
September 8, 2026 14:46
9e8895d to
d835385
Compare
henry3260
approved these changes
Sep 8, 2026
Contributor
|
Hi maintainer, this PR was merged without a milestone set.
|
Contributor
Backport successfully created: v3-3-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
aws-airflow-bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
Sep 8, 2026
…pache#72677) The guard rejected every limit at or below 1, but 0 is the documented value for disabling the limit: argparse accepts it, the flag's own help says "To disable limit, set 0", and the query builder already honours it. Operators running highly available schedulers were left guessing a magic upper bound instead of asking for every alive job, and the error message pointed them away from the value that would have worked. The successor command this one is deprecated in favour of, airflowctl jobs check, has accepted the combination since it was added, so the two CLIs disagreed about the same flag. (cherry picked from commit 9de99f8) Co-authored-by: Y-C <[email protected]> Co-authored-by: Eason09053360 <[email protected]>
vatsrahul1001
pushed a commit
that referenced
this pull request
Sep 9, 2026
…72677) (#72744) The guard rejected every limit at or below 1, but 0 is the documented value for disabling the limit: argparse accepts it, the flag's own help says "To disable limit, set 0", and the query builder already honours it. Operators running highly available schedulers were left guessing a magic upper bound instead of asking for every alive job, and the error message pointed them away from the value that would have worked. The successor command this one is deprecated in favour of, airflowctl jobs check, has accepted the combination since it was added, so the two CLIs disagreed about the same flag. (cherry picked from commit 9de99f8) Co-authored-by: Y-C <[email protected]> Co-authored-by: Eason09053360 <[email protected]>
regarmukesh3g
pushed a commit
to regarmukesh3g/airflow
that referenced
this pull request
Sep 27, 2026
The guard rejected every limit at or below 1, but 0 is the documented value for disabling the limit: argparse accepts it, the flag's own help says "To disable limit, set 0", and the query builder already honours it. Operators running highly available schedulers were left guessing a magic upper bound instead of asking for every alive job, and the error message pointed them away from the value that would have worked. The successor command this one is deprecated in favour of, airflowctl jobs check, has accepted the combination since it was added, so the two CLIs disagreed about the same flag. Co-authored-by: Eason09053360 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
airflow jobs check --allow-multiple --limit 0always exits 1, even though0is the documentedvalue for disabling the limit.
The guard rejected any limit at or below
1:Rejecting
1is correct — asking to see multiple jobs while only inspecting the single most recentone is contradictory. But
0means "no upper bound", which is the opposite of contradictory, and itgot caught by the same
<=.Everything else in the codebase already treats
0as valid:--limit 0cli_config.py—ARG_JOB_LIMITtype=positive_int(allow_zero=True), so argparse accepts0helpjobs_command.check(), a few lines below the guardif args.limit > 0: query = query.limit(args.limit)— already skips theLIMITclause for0airflowctl jobs check— the successor this command is@deprecated_for_airflowctlin favour ofargs.limit == 1and ships a--limit 0 --allow-multipletest asserting successSo the guard was the only place that disagreed, and it made the branch below it unreachable.
Impact
Running highly available schedulers, the natural way to ask "are all my schedulers alive?" is:
The error message then points away from the value that would have worked, so operators fall back to
a guessed upper bound such as
--limit 100(the form the docs and the command epilog show). Thatunder-reports once more jobs than the bound are running.
Changes
args.limit == 1.positive_int(allow_zero=True)already rejects negatives,so the remaining values are
0, 1, 2, …and== 1is exact.0, matchingairflowctl jobs checkverbatim so both CLIs emit thesame sentence.
--limit 0next to the existing high-availability example incheck-health.rst. Theexisting
--limit 100example is left as-is.Tests
test_should_report_success_for_ha_schedulers_with_limit_disabledmirrors the neighbouring--limit 100test with--limit 0. Reverting the one-line guard change and running the whole filefails that test with the old
SystemExit; with the change, all 7 tests in the file pass.The pre-existing
test_should_raise_exception_for_allow_multiple_and_limit_1still passes — thecontradictory
--limit 1case is still rejected.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines