I'm trying wo write a worker that forks its self to process tasks. This means that the Context is created pre-fork. I'm running into a problem where when the child process exits, it triggers an assertion error (presumably) when it's trying to clean up the context/threads it inherited from the parent:
Assertion failed: ok (mailbox.cpp:84)
The code I'm using to produce this is here: https://gist.github.com/2939834
The error occurs on line 41, where the child calls exit();
This commit fixes the same issue in pyzmq: minrk/pyzmq@08bb3a3
I shall take a look
Testing a fix for issue #59
Can you test 25414ce ?
More fixes on #59
Added test for issue #59
This is weird. I'm having the same issue. I tried the fix and I only get the assert sometimes.
Did you try the latest?
Yes, but it might be related to the fact that I am forking off two children. Could that be an issue?
Can you provide code that I can test with?
I hope this is small enough for you to test with: https://gist.github.com/3083407
Whats happening with this? Someone knows how to fix this?
Oh, this explains why it's impossible to use recv in a phpsh repl, since phpsh forks every command…
I'd like to +1 this issue. It's a major pain point in using ømq from PHP.
This isn't a solution to the problem, but I think the following project could be useful as a general solution to this category of problem:
I had this issue and I made a wrapper class to make a lazy context/connection. It might help someone get around the issue. Example: https://gist.github.com/4043814
Add second test for bug #59
Can you clone latest head and run make test? Seems to work now
My example (this one) still results in a failed assertion.
@igorw, try initialising the context as non-persistent:
$c = new ZmqContext (1, false);
Nice, that fixes it.
Closing for now, please reopen if the issue persists.