-
Notifications
You must be signed in to change notification settings - Fork 30
workqueue: add dead-letter support #817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Nghia Tran <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces dead-letter support to the workqueue system by adding new functionality to permanently remove tasks after a maximum number of retry attempts. Key changes include:
- Adding new methods (Fail and GetAttempts) to the OwnedInProgressKey interface and their implementations in both in-memory and GCS-backed queues.
- Updating dispatcher logic to optionally use Fail when a task’s retry count exceeds a configured maxRetry value.
- Enhancing test coverage and configuration (Terraform variables and dispatcher configuration) to support maximum retry functionality.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pkg/workqueue/interface.go | Updated the interface to include Fail and GetAttempts methods. |
pkg/workqueue/inmem/inmem_test.go | Added conformance testing for the maximum retry behavior. |
pkg/workqueue/inmem/inmem.go | Provided in-memory implementations for the new methods. |
pkg/workqueue/gcs/gcs_test.go | Added tests to validate dead-letter behavior using maxRetry. |
pkg/workqueue/gcs/gcs.go | Implemented dead-letter support with metadata updates and metrics in the GCS-based queue. |
pkg/workqueue/dispatcher/handler.go | Extended the Handler function to accept and pass through a maxRetry value. |
pkg/workqueue/dispatcher/dispatcher.go | Updated dispatcher functions to handle maxRetry logic and correctly switch to Fail when needed. |
pkg/workqueue/conformance/conformance.go | Added a new test scenario to validate maximum retry behavior. |
modules/workqueue/variables.tf | Added a new Terraform variable to configure the maximum retry threshold. |
modules/workqueue/dispatcher.tf | Injected the maxRetry configuration into the dispatcher module. |
modules/workqueue/cmd/dispatcher/main.go | Updated the main dispatcher command to pass the maxRetry value to the dispatcher. |
Signed-off-by: Nghia Tran <[email protected]>
93e7861
to
8367384
Compare
Signed-off-by: Nghia Tran <[email protected]>
8367384
to
47fd9c2
Compare
imjasonh
approved these changes
May 12, 2025
Signed-off-by: Nghia Tran <[email protected]>
87e2f4d
to
2bc7b6b
Compare
tcnghia
commented
May 12, 2025
tcnghia
commented
May 12, 2025
af271fa
to
00b5114
Compare
Signed-off-by: Nghia Tran <[email protected]>
00b5114
to
a0639f1
Compare
mattmoor
reviewed
May 12, 2025
mattmoor
reviewed
May 12, 2025
Signed-off-by: Nghia Tran <[email protected]>
mattmoor
approved these changes
May 13, 2025
tcnghia
added a commit
that referenced
this pull request
May 13, 2025
To leverage the metrics added in #817 --------- Signed-off-by: Nghia Tran <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.