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

grpc-js: Properly back off when transitioning through IDLE #1444

Merged
merged 1 commit into from Jun 3, 2020

Conversation

murgatroid99
Copy link
Member

The comment that was previously there is wrong: we don't want to reset the backoff here. If we're in the case where we want to back off, i.e. the application indicates that it wants to keep trying to connect, and we keep failing to connect, the state transition sequence looks like this:

  1. IDLE -> CONNECTING (start connecting)
  2. CONNECTING -> TRANSIENT_FAILURE (fail to connect)
  3. TRANSIENT_FAILURE -> IDLE (backoff timer ends)
  4. IDLE -> CONNECTING (the queue picker from step 3 kicks the subchannel out of IDLE)
  5. ...

The previous code resets the backoff timeout in step 3 of that sequence, which is exactly what we don't want to happen. The backoff timeout should only be reset when transitioning to READY, and that is handled already on line 490.

@murgatroid99 murgatroid99 merged commit 658961d into grpc:master Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants