Skip to content

Conversation

@glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Jul 15, 2020

Motivation:

The recently introduced keepalive handlers have some a configuration option
permitWithoutCalls to control whether pings may be sent when there are
no active RPCs. This was mistakenly applied to receiving pings as well.
For clients, the default is to have this option set to false, any
pings received when no streams were active would result in the client
closing the connection to the server.

Since gRPC implementations may send pings which are not used for
keepalive (libgrpc sends pings to estimate BDP, for example), any such
ping would result in the client closing the connection.

Modifications:

  • Have the GRPCKeepaliveHandlers always respond to pings (unless the
    ping is considered to be a strike)
  • Minor refactoring: change the private now property to be a function
  • Minor refactoring: document isPingStrike
  • Add tests

Result:

We tolerate receiving pings so long as they aren't a strike.

Motivation:

The recently introduced keepalive handlers have some a configuration option
`permitWithoutCalls` to control whether pings may be sent when there are
no active RPCs. This was mistakenly applied to receiving pings as well.
For clients, the default is to have this option set to `false`, any
pings received when no streams were active would result in the client
closing the connection to the server.

Since gRPC implementations may send pings which are not used for
keepalive (libgrpc sends pings to estimate BDP, for example), any such
ping would result in the client closing the connection.

Modifications:

- Have the GRPCKeepaliveHandlers always respond to pings (unless the
  ping is considered to be a strike)
- Minor refactoring: change the private `now` property to be a function
- Minor refactoring: document `isPingStrike`
- Add tests

Result:

We tolerate receiving pings so long as they aren't a strike.
@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Jul 15, 2020
@glbrntt glbrntt requested a review from Lukasa July 15, 2020 12:29
@glbrntt glbrntt merged commit 6fccc59 into grpc:master Jul 15, 2020
@glbrntt glbrntt deleted the gb-tolerate-pings branch July 15, 2020 13:42
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