-
Notifications
You must be signed in to change notification settings - Fork 381
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
Heartbeat trying to emit on None object #63
Comments
Hello, Do you have any simple test case to reproduce this problem? The close() function in the heartbeat object is supposed to kill the heartbeat task before destroying and setting the _channel to None. I am really curious about what is happening over there. Best, |
Thanks for the explanation. One cause for getting them could be that I set heartbeat to 1s, setting it to 10s gets rid of it completely. I still get some of gevent_zeromq bug prints though. I'll see if I can produce a test case for it. I'm also reading along in #37 which could be related (we are also doing similar long lasting tasks.) |
Seeing just the same thing, since we upgraded from zerorpc 0.4.2 + pyzmq 2.2.0.1 to zerorpc 0.4.3 + pyzmq 13.1:
It looks like it doesn't have any other side-effect (for now!), so maybe it's just crashing the greenlet that was spawned to handle a specific request, at the end of the request. |
I guess setting it to 1s makes the heartbeat loop wakeup more often, which then raises the probability of the bug/race to occur... I guess its going to be fun to test. |
I tried to reproduce with different settings (low heartbeat server-side, client-side, both sides); with short and long jobs (gevent.sleep(x) with x from 1 to 60); with up to 100 clients in parallel, and couldn't reproduce the issue :-( |
I met the same issue when using nodejs client interacting with python server. When I invoke the method from python server in nodejs frequently, it appears, here is the result:
|
I have a theory for this bug:
This is just a guess because normally, the heartbeat channel object shouldn't be destroyed before the greenlet... since the greenlet references it. But at the same time, there is a circular reference... and that is maybe the only way the circle gets broken up? Just thinking out loud here... If you could find a way to reproduce the bug with a minimal amount of code, that would greatly help! |
I get this when connecting to a python instance from a node client. My test case is simple, run a process that takes 5 seconds to complete, the client timeout parameter doesn't yield any different results. test.js var zerorpc = require("zerorpc");
var client = new zerorpc.Client({timeout:10000});
client.connect("tcp://127.0.0.1:4242");
for (invoked=0; invoked<10; invoked++) {
client.invoke("testCase",{something:"here"}, function(error, res, more) {
console.log('Results',res);
});
} test.py import zerorpc, time
class testServe(object):
def testCase(self,data):
time.sleep(5)
return data
s = zerorpc.Server(testServe())
s.bind("tcp://127.0.0.1:4242")
s.run() Results (x9):
On the client end, the first request goes through,the rest have: Result: undefined. Removing the time.sleep will result in a succesful data echo ...
|
Any update on this issue? |
try to reproduce with this version of zerorpc: On Thu Dec 04 2014 at 1:23:22 AM Aris Pikeas notifications@github.com
|
This bug should now be fixed. Finally. Latest package v5.0.1 on pypi. |
This happens from time to time with 40+ clients that all have a lot of network and cpu load. I have no idea it this causes the request to fail, but I'm sure it crashes the current (heartbeat?) greenlet, which is never a good thing.
We also get a lot of these, but I suspect we are to aggressive calling combined with a high network load, which makes it acceptable:
The text was updated successfully, but these errors were encountered: