You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/workqueue/README.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,10 @@ module "workqueue" {
21
21
// The number of keys to process concurrently.
22
22
concurrent-work = 10
23
23
24
+
// Maximum number of retry attempts before a task is moved to the dead letter queue
25
+
// Default is 0 (unlimited retries)
26
+
max-retry = 5
27
+
24
28
// The name of a service that implements the workqueue GRPC service above.
25
29
reconciler-service = {
26
30
name = "foo"
@@ -74,6 +78,30 @@ pointing at `WORKQUEUE_SERVICE` with Cloud Run authentication (see the
74
78
}
75
79
```
76
80
81
+
## Maximum Retry and Dead Letter Queue
82
+
83
+
The workqueue system supports a maximum retry limit for tasks through the `max-retry` variable. When a task fails and gets requeued, the system tracks the number of attempts. Once the maximum retry limit is reached, the task is moved to a dead letter queue instead of being requeued.
84
+
85
+
- Setting `max-retry = 0` (the default) means unlimited retries
86
+
- Setting `max-retry = 5` will move a task to the dead letter queue after 5 failed attempts
87
+
88
+
Tasks in the dead letter queue are stored with their original metadata plus:
89
+
- A timestamp in the key name to prevent collisions
90
+
- A `failed-time` metadata field indicating when the task was moved to the dead letter queue
91
+
92
+
Dead-lettered tasks can be inspected using standard GCS tools. They are stored in the workqueue bucket under the `dead-letter/` prefix.
| <aname="input_concurrent-work"></a> [concurrent-work](#input\_concurrent-work)| The amount of concurrent work to dispatch at a given time. |`number`| n/a | yes |
169
+
| <aname="input_max-retry"></a> [max-retry](#input\_max-retry)| The maximum number of retry attempts before a task is moved to the dead letter queue. Default of 0 means unlimited retries. |`number`|`0`| no |
| <aname="input_notification_channels"></a> [notification\_channels](#input\_notification\_channels)| List of notification channels to alert. |`list(string)`| n/a | yes |
0 commit comments