-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Fix retry race condition that can lead to double decrementing inFlightSubStreams and so miss calling closed #11026
Conversation
…tSubStreams and so missing calling closed.
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.
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.
final Future<?> retryFuture; | ||
if (scheduledRetry != null) { | ||
// TODO(b/145386688): This access should be guarded by 'this.scheduledRetry.lock'; instead |
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.
Why remove these? These look disabled by the @SuppressWarnings("GuardedBy")
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.
The way that the comments were done was intrusive and ugly. Changed them all to be on the SuppressWarnings
annotation.
… SuppressWarnings annotation.
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.
This seems ok to me, but there is a lot going on in this class and I'm not that familiar with it. I think we would want the @ejona86 seal of approval here as well.
…tSubStreams and so miss calling closed (grpc#11026)
…tSubStreams and so miss calling closed (grpc#11026)
…tSubStreams and so miss calling closed (grpc#11026)
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.
LGTM
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
DriveSimControllerRuleTest
to fail with the first attempt to fix the retry deadlock.