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

   `add-worker-queues`, `remove-worker-queues`, and `set-worker-concurrency` 
raised bare `SystemExit` after catching a `TypeError` from the model layer 
(raised when the target worker is in `OFFLINE`, `OFFLINE_MAINTENANCE`, or 
`UNKNOWN` state). `SystemExit()` with no argument yields exit code `0`, so 
shell scripts wrapping these commands saw success and continued as if the queue 
or concurrency change had been applied, when in fact it had been silently 
rejected.
   
   Pass the exception message to `SystemExit(str(e))` so the process exits with 
status `1` and writes the failure to stderr. Matches this file's own convention 
for validation-error paths (e.g. `raise SystemExit("Error: No queues specified 
to add.")` a few lines above each fix site) and the `raise SystemExit(str(e))` 
pattern already used in 
`providers/edge3/src/airflow/providers/edge3/cli/worker.py`.
   
   The model layer at 
`providers/edge3/src/airflow/providers/edge3/models/edge_worker.py` already 
calls `logger.error(error_message)` before raising, so the CLI-side 
`logger.error(str(e))` was strictly duplicative and is removed.
   
   Adds parametrized tests over all three subcommands asserting that 
`SystemExit.code` carries the error message (i.e. exit status is `1`, not `0`).
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Cursor 
   


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

Reply via email to