-
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
Problem: infinite hwm of version 4.2 lead to catch no msg #2228
Comments
This was changed to fix a bug, can't remember which, I'll dig it up later today |
So I was thinking of this: #1649 but that's unrelated, I think. Looking at the documentation, 0 meant infinite already in 2.1, so this hasn't really changed: http://api.zeromq.org/2-1:zmq-setsockopt What changed is that now it's possible to modify the HWMs even after a bind/connect, since this PR: #1426 Is this what's causing you a problem? Would you be able to upload to gist/pastebin a minimal test case that reproduces the issue you are facing? Thanks! |
@bluca I just write a test case: In my test case, I write some code to simulate a normal service, which is that frontend svr send msg to backend svr, and wish to recv response from backend. and in the code, frontend svr set hwm after connect, and send total 5000 msg (should bigger than default hwm 1000) and if I build this code with version 4.1.6, I can get what I expected then, I build with 4.2.0, I can only recv 1000 msg from backend. |
The gist is not longer visible |
@bluca here is the gist I found something, that is the pipe bind with socket_base and session_base is descibed as follow
session_base write the data to socket_base
Thus, session_base is full. So, I thank if we also set peer hwm when call set_hwm , will fix it. I will try to fix it this week. |
@bluca I just wrote a thread-safe solution by using command ,and include your pr. By simply test, it works. But afraid of include some mistake. |
Thank you for taking care of it! I can have a look in detail later tonight |
@laplaceyang that looks fine to me. Would you please rebase it and send a PR? |
Thank you for fixing this! Closing as it's solved by PR #2302 |
This allows calls set HWM socket options to happen on an unconnected socket, thus working round ZMQ bug zeromq/libzmq#2228 This works with both versions of ZMQ that do and do not have the bug.
In release version of 4.2, we got a change in
zmq::pipe_t::set_hwms
, that 0 means infinite hwm.but in some case ,I use the dealer mode, and set sndhwm after connect, lead to the hwm and lwm eq 0. which is not my origin idea.
Then if one side (dealer mode)(side A) is infinite hwm, and another (router mode)(side B) set hwm to a limit number. Then A side will never send_activate_write to the peer, accoding to the follow code.
Finally, we got a full hwm by check_hwm, and reset_pollin. Since then, no message can be caught.
The text was updated successfully, but these errors were encountered: