Cloud Tasks will attempt the task max_attempts times (that is, if the
first attempt fails, then there will be max_attempts - 1 retries). Must
be >= -1.
If unspecified when the queue is created, Cloud Tasks will pick the
default.
A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time]
for retry between
[min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and
[max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration
after it fails, if the queue's
[RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the
task should be retried.
If unspecified when the queue is created, Cloud Tasks will pick the
default.
max_backoff will be truncated to the nearest second.
The time between retries will double max_doublings times.
A task's retry interval starts at
[min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff], then
doubles max_doublings times, then increases linearly, and finally retries
at intervals of
[max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] up to
[max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times.
For example, if
[min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] is 10s,
[max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] is 300s,
and max_doublings is 3, then the a task will first be retried in 10s. The
retry interval will double three times, and then increase linearly by 2^3 *
10s. Finally, the task will retry at intervals of
[max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] until the
task has been attempted
[max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times.
Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s,
300s, ....
If unspecified when the queue is created, Cloud Tasks will pick the
default.
If positive, max_retry_duration specifies the time limit for
retrying a failed task, measured from when the task was first
attempted. Once max_retry_duration time has passed and the
task has been attempted
[max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times,
no further attempts will be made and the task will be deleted.
If zero, then the task age is unlimited.
If unspecified when the queue is created, Cloud Tasks will pick the
default.
max_retry_duration will be truncated to the nearest second.
A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time]
for retry between
[min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and
[max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration
after it fails, if the queue's
[RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the
task should be retried.
If unspecified when the queue is created, Cloud Tasks will pick the
default.
min_backoff will be truncated to the nearest second.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eRetryConfig\u003c/code\u003e class in the Google Cloud Tasks v2beta3 API determines how failed task attempts are retried.\u003c/p\u003e\n"],["\u003cp\u003eYou can configure the maximum number of attempts (\u003ccode\u003eMaxAttempts\u003c/code\u003e) for a task, with -1 indicating unlimited retries.\u003c/p\u003e\n"],["\u003cp\u003eThe time between retries can be set using \u003ccode\u003eMinBackoff\u003c/code\u003e and \u003ccode\u003eMaxBackoff\u003c/code\u003e, with \u003ccode\u003eMaxDoublings\u003c/code\u003e determining how many times the retry interval doubles.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eMaxRetryDuration\u003c/code\u003e allows setting a time limit for retrying a failed task from the first attempt, with a value of zero indicating no time limit.\u003c/p\u003e\n"],["\u003cp\u003eThe settings in \u003ccode\u003eRetryConfig\u003c/code\u003e help manage the retry behavior of tasks, mirroring the functionality of \u003ccode\u003etask_retry_limit\u003c/code\u003e, \u003ccode\u003emax_backoff_seconds\u003c/code\u003e, \u003ccode\u003emax_doublings\u003c/code\u003e, \u003ccode\u003etask_age_limit\u003c/code\u003e, and \u003ccode\u003emin_backoff_seconds\u003c/code\u003e found in queue.yaml/xml.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Tasks v2beta3 API - Class RetryConfig (3.0.0-beta07)\n\nVersion latestkeyboard_arrow_down\n\n- [3.0.0-beta07 (latest)](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.RetryConfig)\n- [3.0.0-beta06](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/3.0.0-beta06/Google.Cloud.Tasks.V2Beta3.RetryConfig)\n- [2.0.0-beta08](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/2.0.0-beta08/Google.Cloud.Tasks.V2Beta3.RetryConfig) \n\n public sealed class RetryConfig : IMessage\u003cRetryConfig\u003e, IEquatable\u003cRetryConfig\u003e, IDeepCloneable\u003cRetryConfig\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Tasks v2beta3 API class RetryConfig.\n\nRetry config.\n\nThese settings determine when a failed task attempt is retried. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e RetryConfig \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[RetryConfig](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.RetryConfig), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[RetryConfig](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.RetryConfig), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[RetryConfig](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.RetryConfig), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Tasks.V2Beta3](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3)\n\nAssembly\n--------\n\nGoogle.Cloud.Tasks.V2Beta3.dll\n\nConstructors\n------------\n\n### RetryConfig()\n\n public RetryConfig()\n\n### RetryConfig(RetryConfig)\n\n public RetryConfig(RetryConfig other)\n\nProperties\n----------\n\n### MaxAttempts\n\n public int MaxAttempts { get; set; }\n\nNumber of attempts per task.\n\nCloud Tasks will attempt the task `max_attempts` times (that is, if the\nfirst attempt fails, then there will be `max_attempts - 1` retries). Must\nbe \\\u003e= -1.\n\nIf unspecified when the queue is created, Cloud Tasks will pick the\ndefault.\n\n-1 indicates unlimited attempts.\n\nThis field has the same meaning as\n[task_retry_limit in\nqueue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).\n\n### MaxBackoff\n\n public Duration MaxBackoff { get; set; }\n\nA task will be \\[scheduled\\]\\[google.cloud.tasks.v2beta3.Task.schedule_time\\]\nfor retry between\n\\[min_backoff\\]\\[google.cloud.tasks.v2beta3.RetryConfig.min_backoff\\] and\n\\[max_backoff\\]\\[google.cloud.tasks.v2beta3.RetryConfig.max_backoff\\] duration\nafter it fails, if the queue's\n\\[RetryConfig\\]\\[google.cloud.tasks.v2beta3.RetryConfig\\] specifies that the\ntask should be retried.\n\nIf unspecified when the queue is created, Cloud Tasks will pick the\ndefault.\n\n`max_backoff` will be truncated to the nearest second.\n\nThis field has the same meaning as\n[max_backoff_seconds in\nqueue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).\n\n### MaxDoublings\n\n public int MaxDoublings { get; set; }\n\nThe time between retries will double `max_doublings` times.\n\nA task's retry interval starts at\n\\[min_backoff\\]\\[google.cloud.tasks.v2beta3.RetryConfig.min_backoff\\], then\ndoubles `max_doublings` times, then increases linearly, and finally retries\nat intervals of\n\\[max_backoff\\]\\[google.cloud.tasks.v2beta3.RetryConfig.max_backoff\\] up to\n\\[max_attempts\\]\\[google.cloud.tasks.v2beta3.RetryConfig.max_attempts\\] times.\n\nFor example, if\n\\[min_backoff\\]\\[google.cloud.tasks.v2beta3.RetryConfig.min_backoff\\] is 10s,\n\\[max_backoff\\]\\[google.cloud.tasks.v2beta3.RetryConfig.max_backoff\\] is 300s,\nand `max_doublings` is 3, then the a task will first be retried in 10s. The\nretry interval will double three times, and then increase linearly by 2\\^3 \\*\n10s. Finally, the task will retry at intervals of\n\\[max_backoff\\]\\[google.cloud.tasks.v2beta3.RetryConfig.max_backoff\\] until the\ntask has been attempted\n\\[max_attempts\\]\\[google.cloud.tasks.v2beta3.RetryConfig.max_attempts\\] times.\nThus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s,\n300s, ....\n\nIf unspecified when the queue is created, Cloud Tasks will pick the\ndefault.\n\nThis field has the same meaning as\n[max_doublings in\nqueue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).\n\n### MaxRetryDuration\n\n public Duration MaxRetryDuration { get; set; }\n\nIf positive, `max_retry_duration` specifies the time limit for\nretrying a failed task, measured from when the task was first\nattempted. Once `max_retry_duration` time has passed *and* the\ntask has been attempted\n\\[max_attempts\\]\\[google.cloud.tasks.v2beta3.RetryConfig.max_attempts\\] times,\nno further attempts will be made and the task will be deleted.\n\nIf zero, then the task age is unlimited.\n\nIf unspecified when the queue is created, Cloud Tasks will pick the\ndefault.\n\n`max_retry_duration` will be truncated to the nearest second.\n\nThis field has the same meaning as\n[task_age_limit in\nqueue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).\n\n### MinBackoff\n\n public Duration MinBackoff { get; set; }\n\nA task will be \\[scheduled\\]\\[google.cloud.tasks.v2beta3.Task.schedule_time\\]\nfor retry between\n\\[min_backoff\\]\\[google.cloud.tasks.v2beta3.RetryConfig.min_backoff\\] and\n\\[max_backoff\\]\\[google.cloud.tasks.v2beta3.RetryConfig.max_backoff\\] duration\nafter it fails, if the queue's\n\\[RetryConfig\\]\\[google.cloud.tasks.v2beta3.RetryConfig\\] specifies that the\ntask should be retried.\n\nIf unspecified when the queue is created, Cloud Tasks will pick the\ndefault.\n\n`min_backoff` will be truncated to the nearest second.\n\nThis field has the same meaning as\n[min_backoff_seconds in\nqueue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters)."]]