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

Sync sub/pub inconsistent and often fails using go-zmq4 vs C #109

Closed
hamid-elaosta opened this issue Aug 22, 2017 · 3 comments
Closed

Sync sub/pub inconsistent and often fails using go-zmq4 vs C #109

hamid-elaosta opened this issue Aug 22, 2017 · 3 comments

Comments

@hamid-elaosta
Copy link

Running the following example from the guide; "Node Coordination"
http://zguide.zeromq.org/page:all#Node-Coordination

but using the modified examples from this repository;
https://github.com/pebbe/zmq4/blob/master/examples/syncpub.go
and
https://github.com/pebbe/zmq4/blob/master/examples/syncsub.go

fail almost every time. Running the original guide examples in C succeed every time with the same conditions.

I am using TCP, client and server are on the same machine, compiling against go1.8.3 linux/amd64. Using libzmq5 (4.1.4-7 amd64) on Ubuntu 16.04 amd64 and kernel 4.8.0-58.

Playing around with timings changes the behaviour but is not acceptable for a usable system.

@pebbe
Copy link
Owner

pebbe commented Aug 22, 2017

I had problems getting this to work. Messages were never received. I fixed this by introducing delays.

But it seems that in the mean time the C example has changed. It now uses a high water mark. I introduced this into the example, added an explicit termination of the context, and dropped all the delays. Now it works fine on my machine. Tested also in zmq2 and zmq3.

Can you please test the updated version?

@hamid-elaosta
Copy link
Author

Will do, I had already tested the HWM but it made no difference, I'll try the context termination and let you know.

@hamid-elaosta
Copy link
Author

@pebbe I can confirm that adding the context termination as well as the HWM does indeed solve the issue with my setup. I removed all delays and all messages are received consistently now.

Removing either of the HWM config or the deferred Term of the context breaks it again.

Without HWM of 1.1M & with deferred context term:

1000000 updates sent
Received 387675 updates
Received 374175 updates
Received 408175 updates
Received 368675 updates
Received 423675 updates
Received 411175 updates
Received 400675 updates
Received 416675 updates
Received 420175 updates
Received 394675 updates

with HWM of 1.1M & deferred context term:

1000000 updates sent
Received 1000000 updates
Received 1000000 updates
Received 1000000 updates
Received 1000000 updates
Received 1000000 updates
Received 1000000 updates
Received 1000000 updates
Received 1000000 updates
Received 1000000 updates
Received 1000000 updates

@pebbe pebbe closed this as completed Aug 22, 2017
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

No branches or pull requests

2 participants