[zeromq-dev] python binding, REQ/REP blocking, apparent "deadlock"
George Coles
george.coles at quantitative.com
Fri Oct 15 00:30:52 CEST 2010
Hi,
I have basically been lurking during the last few months of feverish activity on this list. I decided to use zmq for a very simple application that is basically one step above hello world, thinking that not much would probably go wrong. I am using the 2.0.7 python binding, with v 2.0.7 of the core. The client is 64-bit windows, the server is 64-bit debian 5 lenny. The code below is very close to the literal truth. After I start my client, it sends several hundred messages in a few seconds. All seem to go as expected, and no messages are missing on the server side. After an hour or two of inactivity, another single message is sent. This message never gets a reply when sent by the client. I kill the client after a while of waiting, and at this point, the message that was sent to the server comes "unstuck" and is sent on for processing. This is all REQ/REP, and I am neither getting an error from either the server or the client that the connection is closed, nor am I getting an illegal state error as if the req/rep sequence was violated. I can't tell if this issue is random, or whether it is as a result somehow of the length of time the socket is connected. Has anyone eny experience like this? I did not find any issues entered that matched this kind of problem. I would upgrade to the lastest versions but things seem to change very quickly,and I do not find any bugs entered that match my experience.
thx
George
#client
ctx = ZMQ.context(1)
fixMsgsSckt = ctx.socket(ZMQ.REQ)
fixMsgsSckt.connect("tcp://hooha:8080")
while True:
success = fixMsgsSckt.send(s)
print "sent message successed:" + str(success)
fixMsgsSckt.recv()
print "got resp"
#server
ctxIn = zmq.Context(1)
replySocket = ctxIn.socket(zmq.REP)
print 'about to bind on ' + incomingUrl
replySocket.bind(incomingUrl)
while True:
#print 'waiting for msg'
msg = replySocket.recv()
#print 'got msg '
replySocket.send('')
#print str(msg)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20101014/191d89a9/attachment.htm>
More information about the zeromq-dev
mailing list