Skip to content
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

Add a NotBefore option, use it for back-off during retries. #586

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

mattmoor
Copy link
Member

@mattmoor mattmoor commented Oct 6, 2024

This change adds a NotBefore option to the workqueue (not exposed via the proto yet), which directs the implementations to delay when certain keys appear in the queue for processing.

This same mechanism is now used to add a back-off when requeuing keys that carry a priority to keep failing high-priority tasks from starving low-priority tasks (h/t Nghia for thinking of this scenario).

WORKQUEUE_GCS_TEST_BUCKET=mattmoor-testing-workqueue go test -timeout=10m -count=1 ./pkg/workqueue/gcs
ok      github.com/chainguard-dev/terraform-infra-common/pkg/workqueue/gcs      262.813s

@mattmoor mattmoor marked this pull request as draft October 6, 2024 19:43
This change adds a `NotBefore` option to the workqueue (not exposed via the proto yet), which directs the implementations to delay when certain keys appear in the queue for processing.

This same mechanism is now used to add a back-off when requeuing keys that carry a priority to keep failing high-priority tasks from starving low-priority tasks (h/t Nghia for thinking of this scenario).

GCS conformance:
```
WORKQUEUE_GCS_TEST_BUCKET=mattmoor-testing-workqueue go test -timeout=10m -count=1 ./pkg/workqueue/gcs
ok      github.com/chainguard-dev/terraform-infra-common/pkg/workqueue/gcs      262.813s
```

Signed-off-by: Matt Moore <mattmoor@chainguard.dev>
@tcnghia tcnghia marked this pull request as ready for review October 7, 2024 15:48
@tcnghia tcnghia merged commit acbd01c into chainguard-dev:main Oct 7, 2024
82 checks passed
@mattmoor mattmoor deleted the nbf-workqueue branch October 7, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants