-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Blocking zmq_proxy_steerable with PUSH backend and SUB frontend #1382
Comments
Yes, the proxy should stop. Do you want to look at the code and propose a On Fri, Apr 24, 2015 at 1:23 PM, Rik van der Heijden <
|
@hintjens I'm already on it. But I'm wondering, what is the best way to fix it. I've already created a test which reproduces the problem. I found out that is blocks in the send-routine of the forward function in src/proxy.cpp:85. This was expected because the PUSH socket blocks here when the message is not delivered. But in the parent zmq::proxy, a message arrived for the control socket. But this is never reached. Making the send non-blocking when a control-socket is attached can drop messages which conflicts with the spec. Another option is to spawn the control handling in a different thread and stop the send (if busy) somehow. A third option would be to pass along control messages within socket via a new zmq_setsockopt and react to the TERMINATE message. A last resort would be fixing the documentation, and let the application make sure that the socket is pulled before terminating. |
@hintjens Can you please respond, I can't proceed with fixing this issue without input from your side. |
Sorry, I missed your comment.
The correct solution is IMO to only receive from the frontend when the
backend is able to receive messages (poll out is true). This will take a
little work on the code.
|
@hintjens Shall I backport this or do you? |
I've backported to 4-1. It doesn't patch cleanly to 4-x, so if you want to On Fri, May 1, 2015 at 11:22 AM, Rik van der Heijden <
|
There's some stuff missing in Makefile.am, I'm pushing a pull request for On Fri, May 1, 2015 at 11:27 AM, Pieter Hintjens ph@imatix.com wrote:
|
Backport issue zeromq/libzmq#1382 & fix for issue #88
Fix degradation from #1382, POLLOUT was tested but not requested
Also fixed Makefile.am with missing specs for test case.
Merged fix for zeromq#1382
Backported fix for zeromq#1382
Fix degradation from zeromq#1382, POLLOUT was tested but not requested
This one is fixed, it can be closed. :) |
Fix degradation from #1382, POLLOUT was tested but not requested
Today I found out that zmq_proxy_steerable blocks after TERMINATE command via the control socket and when no-one is listening to the push socket. When then an incoming connection reads from the PUSH socket, the proxy is stopped.
I understand that the PUSH blocks when no listeners are there, but expected behavior is that the proxy stops when TERMINATE is sent.
The text was updated successfully, but these errors were encountered: