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

Fix TCP close behavior in case of cuncurrent read+write operations #1727

Merged
merged 5 commits into from Mar 29, 2017

Conversation

Projects
None yet
2 participants
@s-ludwig
Member

s-ludwig commented Mar 28, 2017

Fixes #1726 and possibly #1724.

Show outdated Hide outdated core/vibe/core/drivers/libasync.d
@@ -1315,6 +1329,7 @@ final class LibasyncTCPConnection : TCPConnection/*, Buffered*/ {
}
void acquireReader() {
assert(!m_settings.writer.isWaiting, "Acquiring reader that is already in use.");

This comment has been minimized.

@ZombineDev

ZombineDev Mar 28, 2017

Contributor

I have almost no knowledge of the code, but shouldn't this be m_settings.reader.isWaiting?

@ZombineDev

ZombineDev Mar 28, 2017

Contributor

I have almost no knowledge of the code, but shouldn't this be m_settings.reader.isWaiting?

This comment has been minimized.

@s-ludwig

s-ludwig Mar 28, 2017

Member

I was about to refactor those methods into the Waiter struct... and then went the copy/past route ;)

@s-ludwig

s-ludwig Mar 28, 2017

Member

I was about to refactor those methods into the Waiter struct... and then went the copy/past route ;)

s-ludwig added some commits Mar 28, 2017

Fix libevent socket event handler.
Now always resumes the writer if one is active. Partially resolves issue #1726.
Revert reader/writer connection close notifications.
There was still a chance for an assertion failure because LibeventTCPConnection.close only resumes a reader task if any is active, but no writer task.
@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Mar 29, 2017

Member

Okay, fixed and passing. Merging in.

Member

s-ludwig commented Mar 29, 2017

Okay, fixed and passing. Merging in.

@s-ludwig s-ludwig merged commit 7479a8b into master Mar 29, 2017

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

s-ludwig added a commit that referenced this pull request Apr 10, 2017

Merge pull request #1727 from rejectedsoftware/issue_1726_tcp_close
Fix TCP close behavior in case of cuncurrent read+write operations. Fixes #1726.
(cherry picked from commit 7479a8b)

# Conflicts:
#	source/vibe/core/drivers/libasync.d

@s-ludwig s-ludwig deleted the issue_1726_tcp_close branch Apr 26, 2017

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