vmagamedov / grpclib

Pure-Python gRPC implementation for asyncio
http://grpclib.readthedocs.io
BSD 3-Clause "New" or "Revised" License
936 stars 92 forks source link

Implement connection checks using PING frame. Task #62 #94

Closed a00920 closed 4 years ago

vmagamedov commented 4 years ago

Awesome, thanks! I don't have any complains about your implementation, but would you mind to write also a test?

a00920 commented 4 years ago

@vmagamedov

Tests added.

vmagamedov commented 4 years ago

Thanks! But now I need to discover a new way to configure client/server, instead of ping_delay and ping_timeout arguments, and do this before merging this PR into master.

As you can see here, gRPC Core already has plenty of configuration options. I hope that grpclib will also have similar configuration options in the future.

When I come up with a design of these options I would merge this PR.

vmagamedov commented 4 years ago

Turns out there are lots of things to consider: https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md https://github.com/grpc/grpc/blob/master/doc/keepalive.md

Current implementation will simply cause a GOAWAY frame (disconnect) from the grpcio-based server, because it sends PING frames so frequently.

vmagamedov commented 4 years ago

Merged my WIP channelz branch into master to make it possible to implement keepalive feature properly. Now we know when last DATA frame was sent into connection. Also merged my config branch into master, now we have grpclib.config.Configuration class to configure grpclib.

a00920 commented 4 years ago

started from the beginning in another branch https://github.com/vmagamedov/grpclib/pull/96