-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add distributed transaction scope and ambient enlistment support #149
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: master
Are you sure you want to change the base?
Add distributed transaction scope and ambient enlistment support #149
Conversation
|
Claude finished @PrzemyslawKlys's task —— View job Pull Request Code ReviewReviewing PR #149: Add distributed transaction scope and ambient enlistment support Todo List:
Review SummaryThis PR adds a well-designed distributed transaction coordination system with comprehensive test coverage. The implementation is generally solid but has one critical issue that needs to be addressed. 🚨 Critical Issues1. Completion Timing Bug (Confirms existing review comment)Location: The existing review comment is correct. There's a critical race condition where // PROBLEMATIC: _completed set before all commits verified
CommitLocalTransactions(); // Could throw on any transaction
_transactionScope?.Complete(); // Could also throw
_completed = true; // ❌ Set too earlyImpact: If any commit fails (network drop, constraint violation, etc.), the scope will be marked as completed but Fix: Move 📋 Code Quality Assessment✅ Strengths
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #149 +/- ##
==========================================
+ Coverage 37.00% 37.27% +0.26%
==========================================
Files 72 73 +1
Lines 4094 4258 +164
Branches 952 977 +25
==========================================
+ Hits 1515 1587 +72
- Misses 2420 2503 +83
- Partials 159 168 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| public void Complete() | ||
| { | ||
| _completed = true; | ||
| #if NET472 || NET8_0_OR_GREATER || NET5_0_OR_GREATER || NET6_0_OR_GREATER || NETCOREAPP3_0_OR_GREATER |
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.
Delay marking distributed scope complete until commits succeed
Complete sets _completed = true before attempting to commit the collected provider transactions. If any Commit throws (e.g., connection drops or a provider rejects the commit), Dispose will see _completed already true and will skip RollbackLocalTransactions, leaving the failed transactions merely disposed instead of explicitly rolled back; CompleteAsync has the same ordering. The completion flag should only be flipped after the commit loop succeeds so failures trigger rollback rather than leaving transactions in an indeterminate state.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task