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

Underlying socket is not closed if Akka.IO TCP connection timeouts #1335

Closed
isurakka opened this issue Sep 29, 2015 · 11 comments
Closed

Underlying socket is not closed if Akka.IO TCP connection timeouts #1335

isurakka opened this issue Sep 29, 2015 · 11 comments
Assignees
Milestone

Comments

@isurakka
Copy link

Running this code for 7-14 minutes on my computer causes you to run out of sockets.

The problem appears to be in TcpConnection or SocketChannel. Looks like TcpConnection checks if SocketChannel is open by calling IsOpen but it returns false even if the socket is bound therefore the socket is never closed.

@alvarezdaniel
Copy link

I'm observing the same behavior if I send a Tcp.Connect message to the internal TcpConnection actor, and it cannot connect. If I make a loop trying to connect with no successful operation (no server responding to the connection), In ProcessExplorer I can see that a file handle to "\Device\Afd" is created and it is not released for each connection retry. TcpConnection actor is not closing SocketChannel object, which contains the reference to Socket object. After many retries, the system runs out of handles (sockets).

@Danthar
Copy link
Member

Danthar commented Dec 6, 2016

Is this issue already Addressed in the akka.io branch ? @akkadotnet/core

@alvarezdaniel
Copy link

I've tested in Akka.IO branch, and the problem is gone. In source code I can see that socket object is disposed successfully.

@alvarezdaniel
Copy link

Hello, just a question. When this issue could be merged to main branch and included in a new release? Because in Akka.IO branch is working right, but new release (1.2.0) still has this problem.

@Aaronontheweb
Copy link
Member

@Horusiath was this fixed in your latest set of commits for 1.3?

@alexvaluyskiy
Copy link
Contributor

alexvaluyskiy commented Aug 7, 2017

I think we did not fix this issue. I run the example and got a problem with sockets. @Aaronontheweb, @alvarezdaniel, @isurakka Could you re-check it with the nightly nugets, please?

@alexvaluyskiy alexvaluyskiy modified the milestones: 1.3.1, 1.3.0 Aug 14, 2017
@alexvaluyskiy alexvaluyskiy modified the milestones: 1.3.2, 1.3.1 Sep 7, 2017
@alexvaluyskiy alexvaluyskiy modified the milestones: 1.3.2, 1.3.3 Oct 1, 2017
@Horusiath
Copy link
Contributor

We solved several IO related issues including: #3211, #3188 and several others since the latest release. We need to reevaluate this issue. @Aaronontheweb maybe could help here, as he has product using Akka.IO on production ;)

@Aaronontheweb
Copy link
Member

@Horusiath we haven't seen any issues like this since the Akka.NET v1.3.2 release, since we did the socket IO rewrite in 1.3.0 and patched some of the issues with socket sends in 1.3.1 and 1.3.2. Going to close this one since I think it's been solved.

@mivacode
Copy link

Hi Team, I am observing a leaking handles issue in our environment running version 1.3.5 referenced from nuget. Handles in process explorer are named "\Device\Afd" like in original post by @alvarezdaniel. I double checked this in windbg (!gchandles) and I can see a large number of "Async Pinned Handles".
Is it likely that the problem has been reintroduced in 1.3.5 version?

@Aaronontheweb
Copy link
Member

@mivacode it's possible, have any way of reproducing the issue similar to what was originally described?

@mivacode
Copy link

@Aaronontheweb when I ran your test code with 1.3.5 and did not observe leaking handles. I think our circumstances are slightly different. Since the issue occurred in prod I need to work on reproducing in locally before I can provide more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants