[zeromq-dev] Python / Zmq / Gevent

Antonio Teixeira eagle.antonio at gmail.com
Thu Apr 19 17:42:17 CEST 2012


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 ?

Versions :

Python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)

Gevent
'1.0b2'

PyZmq
'2.1dev'

ZMQ
v2.2.0

One More Thanks For The Help :)
Antonio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120419/68c3bc97/attachment.htm>


More information about the zeromq-dev mailing list