Skip to content

Conversation

@steveahnahn
Copy link
Contributor

Summary

Add configurable retry_delay_multiplier parameter to BaseOperator allowing users to customize the exponential backoff multiplier for task retries (previously hardcoded to 2).

Solution

  • Added retry_delay_multiplier parameter (default: 2.0) to BaseOperator and all downstream usages/references
  • Unit test validates retry calculation with custom multiplier

Testing

Tested with breeze and unit tests with screenshots below:
Screenshot 2025-10-19 at 5 25 48 PM
Screenshot 2025-10-19 at 5 26 47 PM
Screenshot 2025-10-19 at 5 27 04 PM

Related Issues

Closes #56537

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a new parameter for this, or could we allow retry_exponential_backoff to be set to an number instead to control it? (retry_exponential_backoff=True -> 2), retry_exponential_backoff=False -> 0, so its still falsey.

I am also tempted to say this should be a new ser dag version.

Copy link
Contributor

@0BVer 0BVer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jscheffl
Copy link
Contributor

One last moment idea... should we also add something to airflow config lint as during upgrade checks this might need to be changed from a bool to a numeric setting?

@steveahnahn steveahnahn force-pushed the support-retry-multipler-parameter branch from 129ff5c to bc657ea Compare November 12, 2025 20:07
@steveahnahn
Copy link
Contributor Author

Thanks for the suggestion, I looked into this but retry_exponential_backoff is a Dag operator parameter and not an airflow.cfg configuration setting therefore I think it wouldn't apply here.

That said, I did find a bug that was addressed in bc657ea. When converting booleans to floats, float(True) returned 1.0 instead of the original default 2.0 multiplier. This would have completely broken exponential backoff for existing Dags using retry_exponential_backoff=True

@steveahnahn steveahnahn requested a review from potiuk November 13, 2025 03:50
Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM . @jscheffl ?

@jscheffl
Copy link
Contributor

Thanks for the suggestion, I looked into this but retry_exponential_backoff is a Dag operator parameter and not an airflow.cfg configuration setting therefore I think it wouldn't apply here.

Ah, yeah 🤦 ypu are right is not a config entry :-D

@jscheffl jscheffl merged commit e36f024 into apache:main Nov 17, 2025
118 checks passed
aaron-wolmutt pushed a commit to aaron-wolmutt/airflow that referenced this pull request Nov 20, 2025
* support retry multiplier parameter

* new param in serialization schema.json

* fix test: retry multipler param matches schema default

* replace back param with multipler

* missed type hints

* prek regen type hints

* Update airflow-core/src/airflow/models/taskinstance.py

Co-authored-by: 김영준 <youngjun.kim@kurlycorp.com>

* newsfragment addition & backwards compatability

* fix ci/cd rebase prek

---------

Co-authored-by: 김영준 <youngjun.kim@kurlycorp.com>
Copilot AI pushed a commit to jason810496/airflow that referenced this pull request Dec 5, 2025
* support retry multiplier parameter

* new param in serialization schema.json

* fix test: retry multipler param matches schema default

* replace back param with multipler

* missed type hints

* prek regen type hints

* Update airflow-core/src/airflow/models/taskinstance.py

Co-authored-by: 김영준 <youngjun.kim@kurlycorp.com>

* newsfragment addition & backwards compatability

* fix ci/cd rebase prek

---------

Co-authored-by: 김영준 <youngjun.kim@kurlycorp.com>
itayweb pushed a commit to itayweb/airflow that referenced this pull request Dec 6, 2025
* support retry multiplier parameter

* new param in serialization schema.json

* fix test: retry multipler param matches schema default

* replace back param with multipler

* missed type hints

* prek regen type hints

* Update airflow-core/src/airflow/models/taskinstance.py

Co-authored-by: 김영준 <youngjun.kim@kurlycorp.com>

* newsfragment addition & backwards compatability

* fix ci/cd rebase prek

---------

Co-authored-by: 김영준 <youngjun.kim@kurlycorp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support configurable multiplier for retry exponential backoff

5 participants