-
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
Messages are not sent if socket is closed immediately #1264
Comments
Hello, I do not manage to reproduce (on Linux, with libzmq master). |
I tried to compile the program above against libzmq master too—still on Win7 with VS2010, though—and then the message doesn't get sent even if I insert a pause. The program should work, though, right? |
Hello, same problem using zeromq 3.2.4 on linux CentOS 6.6, Changing LINGER values (to -1,0,1,100) has no effect. Setting ZMMQ_SNDHWM to 1 before sending the last message has no effect. The only 'workaround' I found working is to add an usleep(100000) between zmq_send() and zmq_close(). |
Any news about this issue? I have same problem in 4.0.5 |
Hello, for information (someone may find it usefull), we had a problem this morning, still with messages lost but with increased probability depending on CPU topology in VM guests on VMWare.
Communication occurs between 2 threads using inproc.OS is a linux x86_64, Centos 6.6 using CFS kernel scheduler with default settings. |
The bug exists for Visual Studio 2013 too. (I just tested with the current libzmq master.) |
I believe I've solved this with PR #1511. Can you please check with current master? |
@kyllingstad which platform did you test it on? Are you using the script from the bug description to test it? |
Visual Studio 2013 on Windows 7. I am using the same code, yes. |
Check fix in #919 however it seems the fix was not complete |
@kyllingstad, @thehesiod - I believe I have reproduced the issue using the test case in this PR, though I merged into one single program. Still seems to happen. |
see #1922 for my testcase as well. It's python but I'm sure it's a core bug. Kinda strange how OSX doesn't seem to be affected. Perhaps due to a different default for SNDBUF. |
Solution: Add it to help narrow down the problem and for making it a permanent part of the repository, once the issue is solved.
any way we can vote this up? the workarounds are really bad, thanks! |
given this may be related to SNDBUF I'm linking this bug (#1922) which did a lot of digging into the default sizes across various platforms. |
Same issue here, Debian 8 with 4.0.5, large messages are not sent if socket is closed quickly. I have double checked LINGER value is -1, is just being ignored. |
I have the same issue in centos 6.9 and ZMQ 3.1.19. That's really annoying. I have to add a sleep before the close. Otherwise, my other process cannot get the data. It's really simple, i have:
I have set the LINGER to 30 seconds but it seems it doesn't work. |
Those versions are quite old, could you please try with 4.2 and see if you still have issues? |
I would like to upgrade but i don't find perl binding for zmq4 maintained. |
I use https://github.com/lestrrat/p5-ZMQ and it's just fine |
There's also this one but I haven't tried it: https://packages.debian.org/stretch/libzmq-ffi-perl |
Thanks. I'll tried the binding. |
I have tested with zmq 4.2.1 and it's ok |
Ok, great, thanks for confirming @omaralvarez please let us know if 4.2 solves it for you as well - FYI you can get debian 8 packages from our OBS project: http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/Debian_8.0/ |
Since there was no activity in the last year, I assume this is resolved now. |
probably a dup of this anyways: #1922 |
Guys,This might help you. I had faced the same issue in version 4.x.x . ZeroMQ has a socket option by the name ZMQ_SNDHWM. Its default value is 1000. I was testing with load of around 500-900 publisher requests on zeromq subscriber daemon. Publisher socket drops a message if the threshold is reached ( default 1000 ) .After I changed the value to 2000 and above, no messages dropped. |
It appears that messages do not get sent if
zmq_close()
is called immediately afterzmq_send()
, even when the linger period is left at the default of "infinite". This seems contrary to the documentation, which says:Here is a program which demonstrates the issue:
Run the program without any arguments in one terminal, and with a single argument in another, and observe that nothing happens. However, if a wait (either for a certain time period or a user keypress) is inserted after
zmq_send()
and before the subsequentzmq_close()
call, it works as expected (i.e., the messages get printed on the receiving end).Tested with both ØMQ 4.0.4 and
libzmq
master branch (2015-06-09), using Visual Studio 2010 and 2013, on Windows 7.The text was updated successfully, but these errors were encountered: