Skip to content
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

core: Race condition in idleTimer & ManagedChannel#enterIdle #8746

Merged
merged 1 commit into from Dec 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/src/main/java/io/grpc/internal/ManagedChannelImpl.java
Expand Up @@ -349,6 +349,9 @@ private class IdleModeTimer implements Runnable {

@Override
public void run() {
if (lbHelper == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a comment like // Workaround timer scheduled while in idle mode. This can happen from handleNotInUse() after an explicit enterIdleMode() by the user. Protecting here as other locations are a bit too subtle.

And then it'll be clear it is load-bearing when we rework things to simplify.

return;
}
enterIdleMode();
}
}
Expand Down