fix: prevent race condition in PostgreSQL setup#147
Open
Gustaf-Larsson wants to merge 8 commits intoBookBeat:masterfrom
Open
fix: prevent race condition in PostgreSQL setup#147Gustaf-Larsson wants to merge 8 commits intoBookBeat:masterfrom
Gustaf-Larsson wants to merge 8 commits intoBookBeat:masterfrom
Conversation
Gustaf-Larsson
commented
May 26, 2025
- Added a semaphore to prevent setup race conditions
- Wrapped each channel setup in a transaction to ensure atomicity
|
# PR Review 🚀
- The usage of a semaphore to serialize the queue and subscription setup is straightforward and effective.
- Wrapping SQL commands in a transaction via an NpgsqlBatch ensures atomicity, reducing the risk of race conditions.
- Nice abstraction for creating batch commands; it improves maintainability by consolidating command creation.
- The added error handling with try/catch blocks and proper transaction rollback increases robustness.
- Overall, the changes address the race condition issue and improve setup reliability.
Great job! 👍 |
elmaxe
reviewed
May 26, 2025
|
|
||
| try | ||
| { | ||
| await createSchema.ExecuteNonQueryAsync().ConfigureAwait(false); |
Member
There was a problem hiding this comment.
Tycker vi ska köra alla dessa i ett batch-kommando. En round trip till db
elmaxe
reviewed
May 26, 2025
| } | ||
| finally | ||
| { | ||
| Semaphore.Release(); |
Member
There was a problem hiding this comment.
kör csharpier, whitespace här efter
…ctions are used for batches
…nto PostgresSetup
elmaxe
reviewed
Jun 4, 2025
elmaxe
reviewed
Jun 4, 2025
|
elmaxe
reviewed
Jun 11, 2025
| <PackageIcon>knighbus-64.png</PackageIcon> | ||
| <RepositoryUrl>https://github.com/BookBeat/knightbus</RepositoryUrl> | ||
| <Version>2.1.0</Version> | ||
| <Version>2.2.0</Version> |
Member
There was a problem hiding this comment.
mergade en grej före, får ändra till 2.3.0 här
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


