英文:
How does retry_exponential_backoff work in Airflow tasks?
问题
retries
参数设置为3,retry_delay
参数设置为300,retry_exponential_backoff
参数设置为True。当发生重试时,根据指数回退算法,重试将在每次延迟的基础上呈指数增加。
英文:
How do the parameters retries
, retry_delay
and retry_exponential_backoff
interact? When there is a retry, when is it scheduled? Exponential backoff sounds interesting, but how does it work?
e.g. what happens with these parameters? When are the retries scheduled?
retries=3,
retry_delay=300,
retry_exponential_backoff=True
答案1
得分: 1
以下是已翻译好的内容:
理解Airflow如何实现指数退避的代码可以在airflow/models/taskinstance.py
中找到(链接)。指数退避将在每次重试后将等待时间加倍。
以下是不同重试之间等待间隔的示例,以说明调度程序将等待多长时间来重新安排任务进行重试:
重试次数 | 重试延迟 | 指数退避 | 到第一次重试的秒数 | 到第二次重试的秒数 | 到第三次重试的秒数 |
---|---|---|---|---|---|
3 | 60 | 是 | 60 | 120 | 240 |
3 | 60 | 否 | 60 | 60 | 60 |
1 | 120 | 是 | 120 | 不适用 | 不适用 |
1 | 120 | 是 | 120 | 不适用 | 不适用 |
3 | 300 | 否 | 300 | 600 | 1200 |
3 | 300 | 否 | 300 | 300 | 300 |
英文:
The code for understanding how Airflow implements exponential backoff can be found in airflow/models/taskinstance.py
(link). Exponential backoff will double the wait time between retries after every retry.
Here are some examples of different wait intervals between retries to illustrate how long the scheduler will wait to re-schedule a task for a retry:
retries | retry_delay | retry_exponential_backoff | number of seconds to first retry | NoSt second retry | NoSt to third retry |
---|---|---|---|---|---|
3 | 60 | True | 60 | 120 | 240 |
3 | 60 | False | 60 | 60 | 60 |
1 | 120 | True | 120 | N/A | N/A |
1 | 120 | True | 120 | N/A | N/A |
3 | 300 | False | 300 | 600 | 1200 |
3 | 300 | False | 300 | 300 | 300 |
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论