-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat: distributed requests synchronization #13993
Merged
Merged
Conversation
This file contains 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
github-actions
bot
added
solution/studio/designer
Issues related to the Altinn Studio Designer solution.
backend
kind/dependencies
Used for issues or pull requests that are dependency updates
labels
Nov 6, 2024
github-actions
bot
added
the
quality/testing
Tests that are missing, needs to be created or could be improved.
label
Nov 7, 2024
mirkoSekulic
force-pushed
the
feature/distributed-lock
branch
2 times, most recently
from
November 7, 2024 06:59
2c7baff
to
37f6524
Compare
backend/src/Designer/Middleware/UserRequestSynchronization/RequestSyncResolver.cs
Fixed
Show fixed
Hide fixed
backend/src/Designer/Middleware/UserRequestSynchronization/RequestSyncResolver.cs
Fixed
Show fixed
Hide fixed
mirkoSekulic
force-pushed
the
feature/distributed-lock
branch
2 times, most recently
from
November 7, 2024 14:34
8ba8377
to
4ae1b52
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13993 +/- ##
=======================================
Coverage 95.20% 95.20%
=======================================
Files 1740 1740
Lines 22815 22815
Branches 2670 2670
=======================================
Hits 21722 21722
Misses 847 847
Partials 246 246 ☔ View full report in Codecov by Sentry. |
mirkoSekulic
force-pushed
the
feature/distributed-lock
branch
5 times, most recently
from
November 8, 2024 06:43
c4850af
to
6559d90
Compare
mirkoSekulic
force-pushed
the
feature/distributed-lock
branch
from
November 8, 2024 07:12
1a9e181
to
4ec7733
Compare
mirkoSekulic
changed the title
feat: distributed lock
feat: distributed requests synchronization
Nov 8, 2024
framitdavid
approved these changes
Nov 8, 2024
mirkoSekulic
force-pushed
the
feature/distributed-lock
branch
from
November 8, 2024 09:28
faa4efb
to
035f619
Compare
mlqn
approved these changes
Nov 8, 2024
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.
Tested OK in dev! 🚀
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backend
kind/dependencies
Used for issues or pull requests that are dependency updates
quality/testing
Tests that are missing, needs to be created or could be improved.
solution/studio/designer
Issues related to the Altinn Studio Designer solution.
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.
Description
Before this pr, in-memory
UserRequestsSynchronizationService
solution was used to synchronize parallel requests.The solution was designed only to support one replica.
The solution is replaced in pr to support distributed locking.
Generic
RequestSynchronizationMiddleware
was added and designed to synchronize user requests in a distributed environment, ensuring that concurrent requests are handled without conflicts.All explicit locking code is removed from controllers and services.
The logic for determining which endpoints will be synchronized is in the
EndpointNameSyncEvaluator
class.The solution is flexible to add a new endpoint to synchronization.
The existing
EndpointNameSyncEvaluator
class can be used, or another class implementingIRequestSyncEvaluator
can be added to the project and it will be auto-registered.Under the hood PosstgreSql advisory locks are used to synchronize requests.
A file system is used for synchronization in the unit tests.
Gitea integration tests and Playwright tests are using advisory locks.
Related Issue(s)
Verification
Documentation