jvegreg commented on issue #48001:
URL: https://github.com/apache/airflow/issues/48001#issuecomment-2768953575
Thanks for your help. We were able to do the workaround, but with a small
extra step. In this particular case, we wanted to retry only if there was a
problem starting the task, not just in any case. So we also added an
`on_failure_callback` that is checking for this particular error and
suppressing any others:
```python
def retry_on_capacity_error(context):
root_logger = logging.getLogger()
root_logger.info(
json.dumps(
context
)
)
exception = context.get('exception')
if exception and 'Capacity is unavailable at this time' in
str(exception):
raise AirflowException('Capacity is unavailable at this time')
```
Thanks for your help!
--
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]