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

Socket timeout handling breaks message guarantees #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

skaes
Copy link

@skaes skaes commented Jul 16, 2020

The handling of send/receive timeouts is buggy in the current implementation. Messages will be lost when they arrive after a socket timeout.

This patch fixes the problem by moving the timeout handling from the erlang code to the poller thread.

Added a test which shows that socket receive timeouts lead to message
parts being dropped on delivery.
@lukaszsamson
Copy link

@skaes this version of erlzmq is extremely unstable and breaks not only zmq but also erlang NIF guarantees. It has a serious design flaw - It breaks zmq sockets by using them from different threads. Zmq sockets (with exception of experimental client/server and radio/dish) are NOT thread safe. The result are assertion failures deep in libzmq happening randomly. It also has data races, mutex usage issues, resource leaks (thread, file descriptors, memory, erlang NIF resources). I'd strongly advise against using it in production. Please check out my fork https://github.com/lukaszsamson/erlzmq that fixes those issues and also introduces new features and support for more recent libzmq versions

@skaes
Copy link
Author

skaes commented Jul 16, 2020

@lukaszsamson that's interesting. For some reason I did not find your fork. I was aware that there are other problems with the erzlmq code and I had seen that most of the PRs did not receive any feedback. Unfortunately, this library is what you get when you install erlzmq from hex.pm. I'll have a look at your fork, though.

@skaes
Copy link
Author

skaes commented Jul 16, 2020

@lukaszsamson I have cloned your project and ran the tests. One fails out of the box. Would you mind enabling issues on your Github project?

@lukaszsamson
Copy link

@skaes enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants