-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
ClientConn.Close does not wait for connections to be closed before returning #2869
ClientConn.Close does not wait for connections to be closed before returning #2869
Comments
I believe the root cause is: In the helloworld client, You can try to add a The race between |
We still should fix this. The stale bot went rogue (probot/stale#207) and accidentally tagged this - sorry for the spam. |
This is still a problem. Any plans to fix this? |
bump |
If anyone would like to help with this, we don't have time to prioritize it, but are willing to review code. |
@purnesh42H Please assign this issue to me |
@infovivek2020 I have assigned this to you. You don't need RUSTC. The underlying issue is that client.Close() doesn't wait for all connections to be close. See #2869 (comment) |
@purnesh42H on filter the packet in wireshark for TCP connection after and before adding delay(#2869) in client main.go I can't see RST Flag |
@infovivek2020 could you mention how much delay you tried? Are you not able to repro this with any amount of delay or with no delay at all? |
@purnesh42H tried with hour minute and second delay but still i am getting FIN signal in wireshark as i have shared previously |
@purnesh42H panic: cannot update state as grpc.Dial with resolver has not been called goroutine 1 [running]: |
@infovivek2020 was not able to repro this on their machine and asked to work on a different task. Moving it back to unassigned |
Since this bug is 4 years old, and we've done similar work on similar things in the past, I looked, and I think this is still a problem. The issue is here: Lines 1140 to 1149 in 47be8a6
We shutdown the transports by canceling their contexts (inside This is made more difficult because we orphan transports at times, e.g. if we get a GOAWAY on a connection that has a stream open, we create a new connection to the server, but we stop tracking the old one. Let's ignore the TCP stuff in the issue and focus on the fact that calling |
It was not guaranteed that when `transport.Close()` returned, the reader go-routines terminated. All the other channels like, `ctxDone`, `writerDone`, `goAway` are being waited upon for a signal To ensure that `transport.Close()` only return after the reader go-routine terminates: - Wait for the `readerDone` channel to signal the completion This fixes: grpc#2869 RELEASE NOTES: grpc: Wait until reader go routine exits in transport.Close()
Hi, I'm testing the compatibility of helloworld example between https://github.com/tower-rs/tower-grpc and https://github.com/grpc/grpc-go.
I found that the Golang client sent a
RST
TCP flag before it closing connection, however, the Rust client sent aFIN
TCP flag. And, the Rust server think aRST
flag is not proper.This issue is born from this tower-rs/tower-grpc#187.
What version of gRPC are you using?
What version of Go are you using (
go version
)?What operating system (Linux, Windows, …) and version?
What did you do?
If possible, provide a recipe for reproducing the error.
Here is the Wireshark dump of Golang client: https://pastebin.com/XxLkUXQw
And the Screenshot:
got ConnectionReset error: https://github.com/tower-rs/tower-grpc/blob/master/tower-grpc-examples/src/helloworld/server.rs + https://github.com/grpc/grpc-go/tree/master/examples/helloworld/greeter_client
no this kind error: https://github.com/tower-rs/tower-grpc/blob/master/tower-grpc-examples/src/helloworld/server.rs + https://github.com/tower-rs/tower-grpc/blob/master/tower-grpc-examples/src/helloworld/client.rs
got the same kind TCP flag
[RST, ACK]
: https://github.com/grpc/grpc-go/tree/master/examples/helloworld/greeter_server + https://github.com/grpc/grpc-go/tree/master/examples/helloworld/greeter_clientWhat did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: