[zeromq-dev] Python / Zmq / Gevent
Antonio Teixeira
eagle.antonio at gmail.com
Thu Apr 19 22:33:42 CEST 2012
Hello Paul
A socket an IPC socket is been created per greenlet that connects to the
ipc socket.
To be more precise
10 x REQ (ipc://IPC/SOCKET- Connect) and the next hop its a ROUTER that
bind on the ipc socket sitting on the "parent greenlet"
2012/4/19 Paul Colomiets <paul at colomiets.name>
> Hi Antonio,
>
> On Thu, Apr 19, 2012 at 6:42 PM, Antonio Teixeira
> <eagle.antonio at gmail.com> wrote:
> > Hello Once Again :)
> >
> > I have deployed the following scenario :
> >
> > REQ (ipc://IPC/SOCKET- Connect - Using Multiple Threads/ Greenlets) ->
> (IPC
> > ROUTER - Bind ipc://IPC/SOCKET) -> (DEALER TCP - Connect:127.0.0.1:2222)
> > -> (Router TCP Bind :127.0.0.1:2222) - (IPC DEALER - Bind
> ipc://IPC/SOCKET2)
> > -> REP ( Using Multiple Threads/ Greenlets Connect - ipc://IPC/SOCKET2)
> >
> > A Thread make the place of the device with a simple:
> >
> > data = recv()
> > send(data)
> >
> > All code based on this :
> > https://github.com/zeromq/pyzmq/blob/master/examples/gevent/reqrep.py
> >
> > On The REP Side 10 Greenlets
> > On The REQ Side 1 Greenlet
> >
> > 100 Tasks ( A simple print and return)
> >
> > Everything Works Well.
> >
> > The same as above
> >
> > On The REP Side 10 Greenlets
> > On The REQ Side 5 Greenlet
> >
> > It works well until ...
> > Did Not Receive A Response The Destination Server Is Unreachable.
> > Ok so Pieter and other at the mailing list pointed me that if the socket
> > disconnects we clear the socket.
> >
> > self.workerSocket.setsockopt(zmq.LINGER, 0)
> > self.workerSocket.close()
> >
> > And make a new one , well this still doesn't work.
> > The REP Side is still online and available since i can use another
> machine
> > with the "client software ( the REP Part) " and it works perfectly until
> the
> > same happens.
> >
> > So to "The Guide" we go.
> > Set Linger 0 to ensure everything is dropped , checked OK
> > Close the socket and started a new one , checked OK
> > Use identity in case stuff gets funky , so one UUID for each worker
> inside
> > the client set before we connect to the IPC , checked OK
> >
> > So after all this the problem remains but when I'm terminating the
> > client(SIGKILL) i can see that "some pending messages" get dumped and
> sent
> > to the Server ( REQ Part) maybe something jams the device or i have a
> > misconfig ?
> >
>
> You seem to use single REQ socket for multiple requestors, right?
> Either use XREQ socket or create a socket per greenlet.
>
> --
> Paul
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120419/02891cb6/attachment.htm>
More information about the zeromq-dev
mailing list