You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "VladaZakharova (via GitHub)" <gi...@apache.org> on 2026/10/05 12:55:29 UTC
[PR] Decouple [workers] execution_api_retries from Dag Processor and Triggerer [airflow]
VladaZakharova opened a new pull request, #74238:
URL: https://github.com/apache/airflow/pull/74238
This PR decouples Execution API retry configuration for workers, triggerer and dag processor.
Previously all three components used the same [workers] options.
Triggerer and dag processor can now define these options in their own [triggerer] and [dag_processor] sections.
Each option falls back independently to its corresponding [workers] value when it isn't configured. This also allows partial overrides. For example, the Triggerer can override only execution_api_retries while continuing to use the worker values for the minimum and maximum retry wait.
Workers continue to use [workers] by default.
closes: https://github.com/apache/airflow/issues/73196
<!-- SPDX-License-Identifier: Apache-2.0
https://www.apache.org/licenses/LICENSE-2.0 -->
<!--
Thank you for contributing!
Please provide above a brief description of the changes made in this pull request.
Write a good git commit message following this guide: https://chris.beams.io/posts/git-commit/
Please make sure that your code changes are covered with tests.
And in case of new features or big changes remember to adjust the documentation.
For user-facing UI changes, please attach before/after screenshots (or a short
screen recording) so reviewers can assess the visual impact.
Feel free to ping (in general) for the review if you do not see reaction for a few days
(72 Hours is the minimum reaction time you can expect from volunteers) - we sometimes miss notifications.
In case of an existing issue, reference it using one of the following:
* closes: #ISSUE
* related: #ISSUE
-->
---
##### Was generative AI tooling used to co-author this PR?
<!--
If generative AI tooling has been used in the process of authoring this PR, please
change below checkbox to `[X]` followed by the name of the tool, uncomment the "Generated-by".
-->
- [ ] Yes (please specify the tool below)
<!--
Generated-by: [Tool Name] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
-->
---
* Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
* For fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
* When adding dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
* For significant user-facing changes create newsfragment: `{pr_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). You can add this file in a follow-up commit after the PR is created so you know the PR number.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Decouple [workers] execution_api_retries from Dag Processor and Triggerer [airflow]
Posted by "VladaZakharova (via GitHub) via commits" <co...@airflow.apache.org>.
VladaZakharova commented on PR #74238:
URL: https://github.com/apache/airflow/pull/74238#issuecomment-6819041136
hi there! @ashb @amoghrajesh Can you please check the changes?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Decouple [workers] execution_api_retries from Dag Processor and Triggerer [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on code in PR #74238:
URL: https://github.com/apache/airflow/pull/74238#discussion_r4259741045
##########
airflow-core/src/airflow/config_templates/config.yml:
##########
@@ -3231,6 +3255,30 @@ dag_processor:
- how often to refresh DAGs from those sources
- how many files to parse concurrently
options:
+ execution_api_retries:
+ description: |
+ The maximum number of retry attempts to the execution API server.
+ If not set, ``[workers] execution_api_retries`` is used.
+ version_added: 3.4.0
Review Comment:
```suggestion
version_added: 3.5.0
```
##########
task-sdk/src/airflow/sdk/api/client.py:
##########
@@ -1215,11 +1211,42 @@ def _get_ssl_context_cached(ca_file: str | None = None, ca_path: str | None = No
ctx.load_verify_locations(ca_path)
return ctx
- def __init__(self, *, base_url: str | None, dry_run: bool = False, token: str, **kwargs: Any):
+ def __init__(
+ self,
+ *,
+ base_url: str | None,
+ dry_run: bool = False,
+ token: str,
+ retry_config_section: str = "workers",
Review Comment:
This makes the SDK client read `[triggerer]` and `[dag_processor]` itself, so the Task SDK is now coupled to core component config. A typo in the section name also silently falls back to `[workers]`. Can we resolve the values in the triggerer and Dag processor (with the `[workers]` fallback) and pass `retries/retry_wait_min/retry_wait_max` into Client instead?
##########
airflow-core/src/airflow/config_templates/config.yml:
##########
@@ -3231,6 +3255,30 @@ dag_processor:
- how often to refresh DAGs from those sources
- how many files to parse concurrently
options:
+ execution_api_retries:
+ description: |
+ The maximum number of retry attempts to the execution API server.
+ If not set, ``[workers] execution_api_retries`` is used.
+ version_added: 3.4.0
+ type: integer
+ example: ~
+ default: ~
+ execution_api_retry_wait_min:
+ description: |
+ The minimum amount of time (in seconds) to wait before retrying a failed API request.
+ If not set, ``[workers] execution_api_retry_wait_min`` is used.
+ version_added: 3.4.0
+ type: float
+ example: ~
+ default: ~
+ execution_api_retry_wait_max:
+ description: |
+ The maximum amount of time (in seconds) to wait before retrying a failed API request.
+ If not set, ``[workers] execution_api_retry_wait_max`` is used.
+ version_added: 3.4.0
Review Comment:
```suggestion
version_added: 3.5.0
```
##########
airflow-core/src/airflow/config_templates/config.yml:
##########
@@ -3231,6 +3255,30 @@ dag_processor:
- how often to refresh DAGs from those sources
- how many files to parse concurrently
options:
+ execution_api_retries:
+ description: |
+ The maximum number of retry attempts to the execution API server.
+ If not set, ``[workers] execution_api_retries`` is used.
+ version_added: 3.4.0
+ type: integer
+ example: ~
+ default: ~
+ execution_api_retry_wait_min:
+ description: |
+ The minimum amount of time (in seconds) to wait before retrying a failed API request.
+ If not set, ``[workers] execution_api_retry_wait_min`` is used.
+ version_added: 3.4.0
Review Comment:
```suggestion
version_added: 3.5.0
```
##########
airflow-core/src/airflow/config_templates/config.yml:
##########
@@ -3046,6 +3046,30 @@ connection_test:
triggerer:
description: ~
options:
+ execution_api_retries:
+ description: |
+ The maximum number of retry attempts to the execution API server.
+ If not set, ``[workers] execution_api_retries`` is used.
Review Comment:
Please also update the `[workers] execution_api_*` descriptions to say they are the fallback for the triggerer and Dag processor. Otherwise, changing `[workers]` still changes those components unless the user knows about the override, which is the problem in #73196.
##########
task-sdk/src/airflow/sdk/api/client.py:
##########
@@ -1215,11 +1211,42 @@ def _get_ssl_context_cached(ca_file: str | None = None, ca_path: str | None = No
ctx.load_verify_locations(ca_path)
return ctx
- def __init__(self, *, base_url: str | None, dry_run: bool = False, token: str, **kwargs: Any):
+ def __init__(
+ self,
+ *,
+ base_url: str | None,
+ dry_run: bool = False,
+ token: str,
+ retry_config_section: str = "workers",
+ **kwargs: Any,
+ ):
if (not base_url) ^ dry_run:
raise ValueError(f"Can only specify one of {base_url=} or {dry_run=}")
auth = BearerAuth(token)
+ retries = conf.getint("workers", "execution_api_retries")
+ retry_wait_min = conf.getfloat("workers", "execution_api_retry_wait_min")
+ retry_wait_max = conf.getfloat("workers", "execution_api_retry_wait_max")
+ if retry_config_section != "workers":
+ retries = conf.getint(retry_config_section, "execution_api_retries", fallback=retries)
+ retry_wait_min = conf.getfloat(
+ retry_config_section,
+ "execution_api_retry_wait_min",
+ fallback=retry_wait_min,
+ )
+ retry_wait_max = conf.getfloat(
+ retry_config_section,
+ "execution_api_retry_wait_max",
+ fallback=retry_wait_max,
+ )
+ self._request_with_retry = Retrying(
+ retry=retry_if_exception(_should_retry_api_request),
+ stop=stop_after_attempt(retries),
+ wait=wait_random_exponential(min=retry_wait_min, max=retry_wait_max),
+ before_sleep=_log_and_trace_retry,
+ reraise=True,
+ ).wraps(self._request_without_retry)
Review Comment:
`before_log` logs `retry_state.fn`, so retry warnings will now say Starting call to `'...Client._request_without_retry'`. That’s misleading when the call is being retried.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Decouple [workers] execution_api_retries from Dag Processor and Triggerer [airflow]
Posted by "VladaZakharova (via GitHub) via commits" <co...@airflow.apache.org>.
VladaZakharova closed pull request #74238: Decouple [workers] execution_api_retries from Dag Processor and Triggerer
URL: https://github.com/apache/airflow/pull/74238
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org