Skip to content

[Hold for next release] Use the shared QueueBase worker loop - #105

Draft
niemyjski wants to merge 2 commits into
feature/queue-group-idfrom
feature/queue-worker-loop
Draft

niemyjski wants to merge 2 commits into
feature/queue-group-idfrom
feature/queue-worker-loop

Conversation

@niemyjski

Copy link
Copy Markdown
Member

Follow-up to #103 (Queue GroupId). Hold for the next release. Depends on FoundatioFx/Foundatio#584. Stacked on feature/queue-group-id; GitHub retargets it to main once #103 merges.

What

Deletes this provider's copy of the StartWorkingAsync loop and calls the shared QueueBase.StartWorker(...) from StartWorkingImpl. The private _workerErrorCount field is replaced by QueueBase.WorkerErrorCount / ResetWorkerErrorCount().

The result: dequeue errors back off (1s doubling to 30s, with jitter) instead of retrying on a fixed interval or stopping the worker, abandon/auto-complete failures go through the resilience policy and don't stop the worker, and cancellation stops it without counting an error.

References the 13.0.5-preview.queue-worker-loop.0.19 core and TestHarness preview packages. Switch back to the released package before merging.

Risk

Behavior change only in worker error handling. Enqueue, dequeue, complete, abandon and dead-letter paths are unchanged.

Tests

Adds overrides for the new shared tests (StartWorkingAsync_WhenDequeueThrows_KeepsWorkingAsync, StartWorkingAsync_WhenAbandonThrows_KeepsWorkingAsync, StartWorkingAsync_WhenCancelled_StopsWithoutWorkerErrorsAsync). The full suite passed twice locally against the emulator, and the worker tests passed 10 consecutive runs.

Deletes the provider-specific StartWorkingImpl loop in favor of QueueBase.StartWorker (backoff on dequeue errors, cancellation-safe stop, safe abandon/auto-complete) and runs the shared worker fault-injection tests. Requires the Foundatio core change on feature/queue-worker-loop.
@niemyjski
niemyjski force-pushed the feature/queue-worker-loop branch from 408e05a to 12989e1 Compare October 8, 2026 22:01
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.

1 participant