Repository navigation
feat: Improving reliability of future call execution using claim-based model - #4799
marcelomendoncasoares merged 48 commits into
Conversation
marcelomendoncasoares
left a comment
There was a problem hiding this comment.
Great suggestion on the claim-based model. @Crazelu! I've put up a few topics for discussion to ensure the robustness of the solution.
1f2f947 to
1ec203a
Compare
… future calls to be dispatched
844bc6a to
61b8c7f
Compare
marcelomendoncasoares
left a comment
There was a problem hiding this comment.
Nice implementation! A few suggestions for improvement/discussion and then I'll jump for a more detailed review on the tests.
…FutureCall method
marcelomendoncasoares
left a comment
There was a problem hiding this comment.
Great work with the implementation, @Crazelu! A few topics for discussion/improvement on the implementation and to prevent future flakiness on tests. The test coverage is great, with only two cases that I would suggest adding.
…d eagerly return from a future call run when a claim is not acquired
marcelomendoncasoares
left a comment
There was a problem hiding this comment.
Think we're very close now! Only a few small suggestions after the last review.
One last test that I realized we're missing is for reclaimed future calls from the perspective of a recovering server - server A lost the claim but recovered and tried to update the heartbeat after server B already reclaimed it. We test that server B manages to replace a stale lock, but we should also assert that server A aborts the run and does not mess with server B claim. Such test will require two concurrent managers to simulate real world concurrency.
marcelomendoncasoares
left a comment
There was a problem hiding this comment.
LGTM! 🚀
Great work, @Crazelu!
marcelomendoncasoares
left a comment
There was a problem hiding this comment.
A few comments on the changes and suggestion to improve the last integration test.
f5b9b0b
into
serverpod:main
This PR introduces a claim-based model to improve the reliability of future call execution. It guarantees that future calls are executed at-least once even if server unexpectedly crashes just as a due future call is scheduled for execution.
Fixes 3417
Pre-launch Checklist
///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.If you need help, consider asking for advice on the discussion board.
Breaking changes
None