Repository navigation
Fix sending cancellation request if it's requested while reading prepended responses - #5774
Merged
Merged
Conversation
Contributor
Author
|
Surprisingly, everything works and CI is green (even the new test) 🐝 |
NinoFloris
requested changes
Jul 4, 2024
vonzshik
force-pushed
the
5191-cancel-after-prepended-response-fix
branch
from
July 26, 2024 14:08
f1a26cf to
79268fe
Compare
NinoFloris
approved these changes
Sep 10, 2024
NinoFloris
left a comment
Member
There was a problem hiding this comment.
Approved, thanks for writing the test against the mock.
| // Set the flag first before waiting on ReadingPrependedMessagesMRE. | ||
| // That way we're making sure that in case we're racing with ReadingPrependedMessagesMRE.Set | ||
| // that it's going to read the new value of the flag and request cancellation | ||
| _userCancellationRequested = true; |
Member
There was a problem hiding this comment.
Nit: after doing a quick search I see the field is marked volatile. It would help comprehension if we use Volatile.Write/Read throughout instead/additionally.
Contributor
Author
| PerformDelayedUserCancellation(); | ||
| } | ||
| catch (Exception e) | ||
| { |
Member
There was a problem hiding this comment.
Should we want to remove
npgsql/src/Npgsql/Internal/NpgsqlConnector.cs
Line 2056 in 3fce77d
Contributor
Author
There was a problem hiding this comment.
Unless I'm missing something it's already done?
vonzshik
enabled auto-merge (squash)
September 10, 2024 13:59
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.

Fixes #5191
Let's see what CI thinks first.