On Sun, Nov 13, 2011 at 09:13, Thomas S Hatch <[email protected]> wrote:
> > > On Sat, Nov 12, 2011 at 11:37 PM, Thomas S Hatch <[email protected]>wrote: > >> I am seeing something interesting that I suspect is a pyzmq issue. I have >> some code that connects to a REP server and shoots off a REQ, >> then receives. I am changing the code to not hang if the REP server is not >> responding but it hangs when the python function returns. Any ideas what >> could be causing this? >> >> Here is the code (same issue with a poller): >> http://pastebin.com/XGzLxM0j >> >> >> Any ideas? >> > As with almost all hangs in zeromq, the answer is likely LINGER. If you send a request with REQ, and LINGER is left as the default (wait forever), then socket.close will never return until the REP socket starts up, and receives the message. You must set LINGER to something >= 0 in order for close/term to allow the message to be discarded. Can I ask why you have a `while True: ...time.sleep` instead of just using a Poller? An example using LINGER and a Poller: http://pastebin.com/S74s722d > > With some added info, when the application hangs and I hit ctrl-C I get > this error: > > Exception KeyboardInterrupt in <zmq.core.context.Context object at > 0x2722cb0> ignored > > Which leads me to believe that the context is not being cleaned up > correctly. > > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev > >
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
