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

Problem: connection might terminate prematurely #115

Merged
merged 2 commits into from
Mar 30, 2016

Conversation

bluca
Copy link
Member

@bluca bluca commented Mar 30, 2016

Solution: backport fix from zeromq/libzmq#1511

sorenisanerd and others added 2 commits March 30, 2016 17:04
While sending very large messages (far beyond what fits in a the tcp
buffer, so it takes multiple sendto system calls for it to finish),
zmq_close will close the connection regardless of ZMQ_LINGER.

In case no engine is attached, a pipe->check_read() is needed to look
for the delimiter in the pipe and ultimately trigger the pipe
termination.

However, if there *is* an engine attached, the check_read() looks ahead
and finds the delimiter and terminates the connection even though the
engine might actually still be in the middle of sending a message.

This happens because while the io_thread is still busy sending the data,
the pipe can get terminated and the io thread ends up being terminated.
Solution: mention closing issue #1877
@hintjens hintjens merged commit 197a9e0 into zeromq:master Mar 30, 2016
@bluca bluca deleted the linger_fix_backport branch March 30, 2016 18:49
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.

3 participants