Comments (5)
Dug into this a bit further and determined the code is tripping over an assert in ZeroMQ itself in zmq::mailbox_t::send on line 194:
// This should never happen as we've already checked that command size is
// less than PIPE_BUF.
zmq_assert (nbytes == sizeof (command_t));
I'm not at all familiar with ZeroMQ internals but it looks like some sort of fragmented send.
from erlzmq2.
I managed to narrow the crash down to shutdown_stress_test. If I configure the test to create < 46 processes it succeeds the majority of the time with just a few intermittent crashes. Dropping the processes below 30 allows it to pass every time. Anything above 46 processes crashes every single time.
I sprinkled some printf() calls in zmq::mailbox_t::send() and have been able to confirm the crash is due to a short send:
nbytes: 48, sizeof(command_t): 48
Invalid argument
rc == 0 (mailbox.cpp:179)
nbytes: 32, sizeof(command_t): 48
Assertion failed: nbytes == sizeof (command_t) (mailbox.cpp:196)
make: *** [test] Abort trap
I suspect some sort of race where the rep socket is getting closed before the req socket can xmit all its data. Will continue to poke at this as time allows.
from erlzmq2.
Looks like the short sends are being triggered when a socket is either closed or termed. The NIFs and background thread aren't synchronized when either of these ops occur so I think the zmq sockets are getting torn down while still in use, thus causing the short sends. I added a ErlNifCond to erlzmq_socket_t and used it to coordinate closing between erlzmq_nif_close and the worker thread. This seemed to improve stability but didn't eliminate the crashes.
from erlzmq2.
Hi Kevin,
Sorry for the late answer, I think the solution is to be found on the zeromq tuning page.
Apart from the ulimit change, here's what's stated:
0mq uses socketpairs for internal signaling and communications. To avoid overrunning this resource, expand these buffers. Edit the /etc/sysctl.conf file and add two lines and reboot: net.local.stream.sendspace=3000000 net.local.stream.recvspace=3000000
from erlzmq2.
Thanks for the pointer to the relevant sysctl entries. Making the recommended edits seems to have fixed the problem completely. I can now run back-to-back sets of unit tests without a single crash.
from erlzmq2.
Related Issues (20)
- erlzmq:term/1 does not release memory HOT 1
- Compilation error on SunOS HOT 3
- Compilation Error on Ubuntu HOT 8
- Error with make bench
- fails to clone
- Missing documetation re Active Sockets HOT 1
- make bench never finishes
- second bind of the same ipc does not fail HOT 3
- Fails to compile on Mac os X (1.7.4) HOT 3
- active mode assumes self() should receive all responses HOT 1
- Problem building on Mountain Lion HOT 7
- rebar get-deps fails HOT 1
- When using a timeout when calling erlzmq:recv () can lose a message HOT 2
- how to compile under windows 7? HOT 1
- erlzmq bind failed HOT 1
- erlang:halt/1 is broken HOT 2
- erlzmq_nif_resource_socket - enif_release_resource HOT 1
- Compiling zeromq library fails
- Does it support CurveZMQ?
- Problem compiling in Alpine Linux HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from erlzmq2.