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

   # When is an error code not an error code?
   
   The `BashOperator` has a `skip_exit_code` param, which is used to identify 
the return code from the underlying command which means 'this task hasn't 
failed, but should instead be skipped'.
   
   This PR adds something similar to the `BashSensor`: a `retry_exit_code` that 
(if set) defines the only non-zero return code that _doesn't_ cause the sensor 
to fail. All other non-zero return codes result in the sensor failing.
   
   For backwards compatibility, if the code is not set (which is the default) 
then you get the current behaviour which is for all non-zero return codes to 
cause the sensor to retry the check, i.e. it retries until timeout or it 
returns zero.
   
   # Why is this useful?
   
    If your sensor is e.g. spinning up a docker container and you get some 
flags wrong, then under the current behaviour the sensor will never succeed, 
but also never fail until it times out. It would be much more useful if you 
could detect malformed commands immediately (fail fast).
   


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