Please answer these questions before submitting your issue.
libprotoc 3.5.1
go version)?go version go1.9 darwin/amd64
Mac 10.11.6
We had one use case that: sending the requests through goroutines by grpc clients to a same endpoint simultaneously, but there is a grpc error happened "rpc error: code = Unavailable desc = transport is closing error happened", this error is not shown every time,but frequently.
And if sending requests through goroutines but to different endpoints, it can work well
I expected that the grpc is able to support handling the client requests concurrently.
@yangliCypressTest Thanks for reporting.
Can you clarify a few things please:
GRPC_GO_LOG_SEVERITY_LEVEL=info
GRPC_GO_LOG_VERBOSITY_LEVEL=2
Did you get gRPC via go get or by vendoring a specific version?
Also, we'll need more information; a reproduction of the issue would be the most ideal case.
Meanwhile, you could also share all the logs from the client and the server.
Note that this is a use case that gRPC supports and has integration tests for it too. If there's a bug, we'll need help zeroing it down.
@yangliCypressTest do you have any updates on this issue?
we found the root cause yet, will close this issue. Thank you
@yangliCypressTest Could you share some details of the root cause, it may help others debug similar issues.
@yangliCypressTest i am also having a similar issue please share what fixed it
some implemention error, the global variables of grpc client were used by mistake.
Please explain the answer - this is not enough for us to know what to do to resolve this
@malengatiger "transport is closing" error is often caused by the server closing the connection. Try to look at the server side logging and see if there's any transport error there.
Even I am facing this issue. Server side logs are as below -
INFO: 2018/10/13 23:19:32 parsed scheme: ""
INFO: 2018/10/13 23:19:32 scheme "" not registered, fallback to default scheme
INFO: 2018/10/13 23:19:32 ccResolverWrapper: sending new addresses to cc: [{localhost:10000 0 <nil>}]
INFO: 2018/10/13 23:19:32 ClientConn switching balancer to "pick_first"
INFO: 2018/10/13 23:19:32 pickfirstBalancer: HandleSubConnStateChange: 0xc000148060, CONNECTING
grpc on port: 10000
INFO: 2018/10/13 23:19:32 pickfirstBalancer: HandleSubConnStateChange: 0xc000148060, READY
INFO: 2018/10/13 23:19:32 transport: loopyWriter.run returning. connection error: desc = "transport is closing"
INFO: 2018/10/13 23:19:32 pickfirstBalancer: HandleSubConnStateChange: 0xc000148060, TRANSIENT_FAILURE
Can anyone help me in understanding this issue?
@vaishalig2693 - Those logs are client-side logs, not server-side.
These errors are happening extremely early in the connection. You could try setting grpc.WithWaitForHandshake in your DialOptions and see if anything else shows up in the logs. My guess is the connection was never actually valid. Are you using TLS or WithInsecure?
I am using WithInsecure. Looks like as pointed by one of the issues, it doesn't work with "WithInsecure"
@vaishalig2693 - everything should work correctly with WithInsecure if the server is configured accordingly. My guess is you are not connecting to the correct host/port, or the server is expecting your client to use TLS, not plaintext.
I had been using this example - https://github.com/philips/grpc-gateway-example/issues/22. I only changed TLS options with WithInsecure and was getting "transport is closing" again and again.
In this issue, it has been suggested to use cmux if we want to have common insecure port for REST and grpc
FWIW server-configuration is what solved the problem for me: https://stackoverflow.com/a/54703234/382564
Most helpful comment
@yangliCypressTest Could you share some details of the root cause, it may help others debug similar issues.