Hide Forgot
Created attachment 503546 [details] Test script to stimulate the issue If we call the Connection.establish("any broker"), and then spawn a process that has a Connection.establish("any broker") the Connection.establish will never return. I have provided a test script to illustrate the problem. Its a simple script it basically does the following: 1. Create a connection and receiver 2. Spawn the Process class 3. The process class spawns 2 threads which call Connection.establish You will see the Connection.establish never returns. --- Notes from messing around with this I think the issue is relating to the drives _buf attribute getting cleared/currupted. I can see headers getting packed, and then randomly getting cleared by some extenernal process.
The issue might be with the Selector class, it basically is reusing the same selector, but when we create the child process this is no longer valid. Potential fix: class Selector: lock = Lock() DEFAULT = {} @staticmethod def default(): Selector.lock.acquire() try: process_id = os.getpid() if(not Selector.DEFAULT.has_key(group)): sel = Selector() atexit.register(sel.stop) sel.start() Selector.DEFAULT[process_id] = sel return Selector.DEFAULT[process_id] finally: Selector.lock.release()
There is a typo in the abox the if(not Selector.DEFAULT.has_key(group)): should read if(not Selector.DEFAULT.has_key(process_id)):