grpc-go icon indicating copy to clipboard operation
grpc-go copied to clipboard

Fix possible race in Keepalive test: KeepaliveClientClosesWithActiveStreams

Open arvindbr8 opened this issue 2 years ago • 4 comments

KeepaliveClientClosesWithActiveStreams test creates a server which does not respond to keepalive pings, and makes sure that the client closes the transport even when there is an active stream. However there is a possibility of a race here.

In the test we assign a large enough ClientParameters.Time. However this does not guarantee that a stream can be created successfully before the timeout hits. This is because with the NoPingServer we do not have a configurable way to switch between a ping/noping server.

This way we can verify that the "no ping server" actually respond to pings until you set a flag, at which point it stops responding and the timeout kicks in to close the transport.

arvindbr8 avatar Mar 08 '23 22:03 arvindbr8

You can assign me

ulascansenturk avatar Mar 30 '23 20:03 ulascansenturk

Sure! Please let me know if something doesn't make sense in the description. We can discuss the approach in this issue first before we send a PR out for review.

arvindbr8 avatar Mar 31 '23 23:03 arvindbr8

Hello @arvindbr8 I would like to look into this issue. If it's ok, please go ahead and assign it to me. One clarification question if you don't mind: , do you mean that, when toggled, the server should skip ping frames handling? If so, I might reuse http2Server and just flip handling ping frames according to the test settings.

tobotg avatar May 14 '23 10:05 tobotg

Yes that should work. Assigning this issue to you @tobotg. Let us know if you have any further questions.

arvindbr8 avatar May 15 '23 16:05 arvindbr8