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

Windows C# socket leak #13519

Closed
yayaboring opened this issue Nov 28, 2017 · 4 comments
Closed

Windows C# socket leak #13519

yayaboring opened this issue Nov 28, 2017 · 4 comments

Comments

@yayaboring
Copy link
Contributor

yayaboring commented Nov 28, 2017

Please answer these questions before submitting your issue.

Should this be an issue in the gRPC issue tracker?

What version of gRPC and what language are you using?

1.7.1 and C#

What operating system (Linux, Windows, …) and version?

Windows 7 SP1

What runtime / compiler are you using (e.g. python version or version of gcc)

.Net Framework 4.5.2

What did you do?

GrpcSocketLeak.zip
the code trying to connect server which not listen.
In test code, I set "grpc.testing.fixed_reconnect_backoff_ms" to 1000 and used 100 parallel connections for it appear more quickly.

What did you expect to see?

number of handles does not increasing endlessly.

What did you see instead?

number of handles increasing endlessly and when it stops increasing, (after running about 10 minutes)
and try to surf internet using web browser, it shows connection refused.

Anything else we should know about your project / environment?

In my project, connectivity is important information.

@yayaboring
Copy link
Contributor Author

yayaboring commented Dec 3, 2017

below one line of code will slow down this leak.
File: tcp_client_windows.c line:105
if (!wsa_success) {
closesocket(socket->socket);
error = GRPC_WSA_ERROR(WSAGetLastError(), "ConnectEx");

@luchunminglu
Copy link

#13102 describe a similar bug as this one

@yayaboring
Copy link
Contributor Author

I made pull request
#13604

@jtattermusch
Copy link
Contributor

Fixed by #13604.

jtattermusch pushed a commit to jtattermusch/grpc that referenced this issue Dec 13, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Sep 30, 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

4 participants