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

Extract the logic from the GRPCIdleHandler into a state machine #1068

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Dec 8, 2020

Motivation:

Shutting down gracefully is generally a better option than slamming the
door in the remote peer's face. To that end we need to do a better job
of handling GOAWAY frames (both receiving and sending them). At the
moment these are received by the 'GRPCIdleHandler' and used as an
indication to close the connection. Since we also have to deal with
various client connection management state the handler has grown a
little out of hand.

Modifications:

  • Pull the state machine out of the idle handler, add support for
    quiescing (to the state machine, not to the handler)

Result:

  • Idle handler is way easier to follow

@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Dec 8, 2020
@glbrntt glbrntt requested a review from Lukasa December 8, 2020 17:42
@glbrntt
Copy link
Collaborator Author

glbrntt commented Dec 8, 2020

I should add that PR doesn't add support for shutting down gracefully: it just paves the way for it.

Copy link
Collaborator

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

LGTM, seems like a good refactor.

Motivation:

Shutting down gracefully is generally a better option than slamming the
door in the remote peer's face. To that end we need to do a better job
of handling GOAWAY frames (both receiving and sending them). At the
moment these are received by the 'GRPCIdleHandler' and used as an
indication to close the connection. Since we also have to deal with
various client connection management state the handler has grown a
little out of hand.

Modifications:

- Pull the state machine out of the idle handler, add support for
  quiescing (to the state machine, not to the handler)

Result:

- Idle handler is way easier to follow
@glbrntt glbrntt merged commit 285a60f into grpc:main Dec 9, 2020
@glbrntt glbrntt deleted the gb-quiescing branch December 9, 2020 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants