-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Ensure WriteMessagesAsync/SaveAsync is called asynchronously in Async… #8163
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same timing issues with the health checks here - replaced all of the fragile test scheduler stuff with |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -392,7 +392,15 @@ private async Task ExecuteBatch(WriteMessages message, int atomicWriteCount, IAc | |
| try | ||
| { | ||
| var writeResult = | ||
| await _breaker.WithCircuitBreaker((prepared, awj: this), (state, ct) => state.awj.WriteMessagesAsync(state.prepared, ct)).ConfigureAwait(false); | ||
| await _breaker.WithCircuitBreaker( | ||
| (prepared, awj: this), | ||
| async (state, ct) => | ||
| { | ||
| // Ensure WriteMessagesAsync is not called in AsyncWriteJournal | ||
| // actor context and so doesn't block message handling | ||
| await Task.Yield(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks fine to me - does exactly what is advertised. |
||
| return await state.awj.WriteMessagesAsync(state.prepared, ct); | ||
| }).ConfigureAwait(false); | ||
|
|
||
| ProcessResults(writeResult, atomicWriteCount, message, _resequencer, resequencerCounter, self); | ||
| } | ||
|
|
||
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.
Had to harden the timing assertions in these specs due to the new
Task.Yieldbehavior on the journal / snapshot stores, but the health check implementations themselves look to be unaffected by this.