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

Explictly avoid double-resumption of tasks during Libevent2TCPConnection.close(). Fixes #1441. #1443

Merged
merged 2 commits into from
Feb 27, 2016

Conversation

s-ludwig
Copy link
Member

The previous fix for #1376 resulted in a possible task starvation when the peer reset the connection before the outbound buffer was drained. The new approach now always resumes the waiting task exactly once, no matter how many events happen and no matter in which order.

See #1441.

…ion.close().

The previous fix for #1376 resulted in a possible task starvation when the peer reset the connection before the outbound buffer was drained. The new approach now always resumes the waiting task exactly once, no matter how many events happen and no matter in which order.
@skoppe
Copy link
Contributor

skoppe commented Feb 26, 2016

I looked at the code. Seems good.

One thing though, the error I had in #1441 was because SSL_shutdown was sending a close notification on a socket that got terminated at the other end, which tripped the internal logic and caused the freeze. Shouldn't the client in the test case send something (to simulate the SSL_shutdown) before the call to close??

In any case, tomorrow I will run my program with this branch and see what happens.

@s-ludwig
Copy link
Member Author

Shouldn't the client in the test case send something (to simulate the SSL_shutdown) before the call to close??

https://github.com/rejectedsoftware/vibe.d/pull/1443/files#diff-777a04d9e996a44ad0d7c0993f6a7437R10

The case also fails as expected on master.

@skoppe
Copy link
Contributor

skoppe commented Feb 27, 2016

@skoppe
Copy link
Contributor

skoppe commented Feb 27, 2016

I can confirm this fixes my issue

@s-ludwig
Copy link
Member Author

Ah okay, but it shouldn't matter whether it is the server or the client that tries to do the send. The connection is basically symmetric in all aspects that matter, after the initial handshake.

The dub registry is also running flawlessly so far (still too early to judge, but it usually stalled after a few hours max. recently).

s-ludwig added a commit that referenced this pull request Feb 27, 2016
Explictly avoid double-resumption of tasks during Libevent2TCPConnection.close(). Fixes #1441.
@s-ludwig s-ludwig merged commit 5b55662 into master Feb 27, 2016
@skoppe
Copy link
Contributor

skoppe commented Feb 27, 2016

Ah, good old symmetry.

@s-ludwig s-ludwig deleted the issue1441-tcp-hang branch February 27, 2016 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants