Skip to content

Conversation

@glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Jun 1, 2020

Motivation:

Connections should be dropped to save resources if there are not RPCs
for an idle timeout. This was added for clients in #798; this adds
similart functionality to the server.

Modifications:

  • Add a GRPCServerIdleHandler to drop connections after 5 minutes of
    no RPCs

Note: timeout configuration will be added for client and server in a
followup PR.

Result:

@glbrntt glbrntt requested a review from Lukasa June 1, 2020 10:00
@glbrntt glbrntt added nio 🔨 semver/patch No public API change. labels Jun 1, 2020
@glbrntt glbrntt force-pushed the gb-server-idle-timeout branch 2 times, most recently from 472cac0 to f75b1c4 Compare June 1, 2020 13:26
Motivation:

Connections should be dropped to save resources if there are not RPCs
for an idle timeout. This was added for clients in grpc#798; this adds
similart functionality to the server.

Modifications:

- Rename a `ClientConnectivityHandler` to `GRPCIdleHandler`
- Add a 'mode' to the idle handler

Note: timeout configuration will be added for client and server in a
followup PR.

Result:

- Server's will drop connections if the client isn't doing anything.
- Resolves grpc#706
@glbrntt glbrntt force-pushed the gb-server-idle-timeout branch from f75b1c4 to 4c804d4 Compare June 2, 2020 08:26
@glbrntt
Copy link
Collaborator Author

glbrntt commented Jun 3, 2020

ping @Lukasa

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.

This looks awesome, the refactoring has made this really nice. :shipit: :

@glbrntt glbrntt merged commit 4dd5ee2 into grpc:master Jun 3, 2020
@glbrntt glbrntt deleted the gb-server-idle-timeout branch June 3, 2020 16:26
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.

Close client connection when it becomes idle

2 participants