You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.
On Windows the GRPC client doesn't close its opened TCP connections on drop, only after the client process ends.
Trying to reproduce this, I created a slightly modified version of the hello world example client code. Here a new GRPC client is created once per iteration in a loop, sends a HelloRequest and is dropped at the end.
$ netstat -an | grep "50051" TCP [::]:50051 [::]:0 LISTENING TCP [::1]:50051 [::1]:64100 ESTABLISHED TCP [::1]:50051 [::1]:64101 ESTABLISHED TCP [::1]:50051 [::1]:64102 ESTABLISHED TCP [::1]:64100 [::1]:50051 ESTABLISHED TCP [::1]:64101 [::1]:50051 ESTABLISHED TCP [::1]:64102 [::1]:50051 ESTABLISHED
The "ESTABLISHED" connections will only end, if we exit the client process. Otherwise they will remain open forever and new iterations create additional connections.
On Windows the GRPC client doesn't close its opened TCP connections on drop, only after the client process ends.
Trying to reproduce this, I created a slightly modified version of the hello world example client code. Here a new GRPC client is created once per iteration in a loop, sends a HelloRequest and is dropped at the end.
The modified example can be found at https://github.com/geomaniac/hello_world_grpc.
The modified client code is in client.rs.
Now, starting the server and letting the client iterate three times, we can see the following on Windows or Linux.
On Windows
Before first iteration:
After three iterations:
The "ESTABLISHED" connections will only end, if we exit the client process. Otherwise they will remain open forever and new iterations create additional connections.
On Linux
Before first iteration:
After three iterations:
The "TIME_WAIT" connections will end after about 60 seconds.
I would expect that the GRPC client also closes its connections on Windows, when it is dropped.
The text was updated successfully, but these errors were encountered: