-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add outbox retry timeout #862
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #862 +/- ##
==========================================
- Coverage 66.42% 66.41% -0.01%
==========================================
Files 382 382
Lines 20782 20797 +15
Branches 2717 2723 +6
==========================================
+ Hits 13805 13813 +8
- Misses 6007 6012 +5
- Partials 970 972 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Enkidu93
left a comment
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.
Thank you, Peter!
I believe the subscription should be waiting for an insert to the collection, not an update or deletion. If it isn't, I think that's a bug, but I could be wrong.
Also, I may be misunderstanding, but this back-off you've implemented, won't it affect the processing of all messages? I would have thought that we'd want to have a retry mechanism per message group so that we don't hold up all builds if one is having problems. It may be that I'm just not following the code correctly.
@Enkidu93 reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ddaspit).
ddaspit
left a comment
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.
@ddaspit reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @pmachapman).
src/ServiceToolkit/src/SIL.ServiceToolkit/Services/OutboxDeliveryService.cs line 170 at r1 (raw file):
{ // log error await messages.UpdateAsync(m => m.Id == message.Id, b => b.Inc(m => m.Attempts, 1));
Is Attempts no longer needed? Can we remove it?
Fixes #834
To test locally, stop the
serval-machine-enginecontainer, and start a build (for example using the API example). Messages will then retry with an exponential back off.Restarting
serval-machine-enginewill cause the messages succeed on retry when the timeout is hit. Previously, messages would not retry in a service outage like this, blocking the queue.Due to the way the subscription appears to work (watching the first message in the queue for update or deletion), the timeout is in effect as long as there are messages in the queue, and the sending of the first message in the queue has failed. This works correctly now that the attempts counter for that item is no longer incremented (which triggered the subscription, which ran process messages, which failed, which triggered the subscription... ad infinitum).
When the queue is empty, the arrival of the first message in the queue will commence processing, as per before.
This change is