Fix retry race condition that can lead to double decrementing inFlightSubStreams and so miss calling closed#11026
Merged
larry-safran merged 3 commits intogrpc:masterfrom Mar 22, 2024
Merged
Conversation
…tSubStreams and so missing calling closed.
temawi
reviewed
Mar 21, 2024
Contributor
temawi
left a comment
There was a problem hiding this comment.
Are these changes covered by an existing unit test or do we need more test code?
… to happen after safeCloseMasterListener was called. Also update a couple of tests to pick up more issues.
ejona86
reviewed
Mar 21, 2024
| final boolean wasCancelled = (scheduledRetry != null) ? scheduledRetry.isCancelled() : false; | ||
| final Future<?> retryFuture; | ||
| if (scheduledRetry != null) { | ||
| // TODO(b/145386688): This access should be guarded by 'this.scheduledRetry.lock'; instead |
Member
There was a problem hiding this comment.
Why remove these? These look disabled by the @SuppressWarnings("GuardedBy")
Contributor
Author
There was a problem hiding this comment.
The way that the comments were done was intrusive and ugly. Changed them all to be on the SuppressWarnings annotation.
… SuppressWarnings annotation.
larry-safran
added a commit
to larry-safran/grpc-java
that referenced
this pull request
Mar 22, 2024
…tSubStreams and so miss calling closed (grpc#11026)
larry-safran
added a commit
to larry-safran/grpc-java
that referenced
this pull request
Mar 22, 2024
…tSubStreams and so miss calling closed (grpc#11026)
This was referenced Mar 22, 2024
larry-safran
added a commit
to larry-safran/grpc-java
that referenced
this pull request
Mar 22, 2024
…tSubStreams and so miss calling closed (grpc#11026)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Future.cancel can return true when the executable has started, but the future value hasn't yet been set which was causing us to do an extra decrement. That is what was causing
DriveSimControllerRuleTestto fail with the first attempt to fix the retry deadlock.