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

grpc does not re-establish duplex streams when writes are pending #80

Closed
connor4312 opened this issue Nov 5, 2017 · 2 comments
Closed

Comments

@connor4312
Copy link

connor4312 commented Nov 5, 2017

The sequence of events I'm hitting is:

  1. An existing connection fails; the client tries to reconnect
  2. I create a new grpc stream. It seems like this gets created lazily, and is connected before the remote server actually recovers and starts accepting connections.
  3. I write on the stream
  4. The server recovers and starts accepting connections
  5. But, the write never goes through and the TCP connection does not get created. Eventually the test case times out.

I have traced the call to this startBatch call. The call is made, but the callback never fires, and eventually the test case times out. No TCP connection is made to the remote server and calls are not recorded. If I switch the order of step 3 and 4, adding a delay before the write happens, it works fine.

This is the full test case I'm running. I have grpc set up to hit a simple TLS proxy server which I can use to simulate network disruptions. pause() tears down the server and terminates all existing connections, resume() recreates the server. By manually adding a delay before the proxy.resume(), I can guarantee this event ordering--the library will try to reconnect to the server as in step 2-3 in the meantime.

@murgatroid99 murgatroid99 self-assigned this Jan 9, 2018
@murgatroid99
Copy link
Member

I'm sorry for taking so long to respond to this. What you describe does not match our own observations, so I'm not sure what might be happening there. Also, the objects you are working with in that test don't seem to have the same semantics as a gRPC client, so I can't tell what exactly should be happening at the gRPC level. Is it possible that you're trying to use a single stream that you created before the proxy was shutdown? If you did that, then the stream would not be moved over to the new server, and it would block until the client realizes that the connection is broken.

If you are still experiencing this problem, can you provide the log output from running the test with the environment variables GRPC_TRACE=all GRPC_VERBOSITY=DEBUG?

@nicolasnoble
Copy link
Member

Closing, since it got no response for 40 days.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants