You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import zerorpc
c = zerorpc.Client(timeout=0.1)
c.connect("tcp://192.168.33.12:4242")
count = 0
while True:
print(count)
try:
print c.hello("RPC", async=False)
except zerorpc.exceptions.TimeoutExpired as e:
print(e)
count+=1
the server above is not reachable, it will kept print timeout message, but over 1,000 times, it stuck in gevent.queue.Channel.put()
output
992
timeout after 1s, when calling remote method hello
993
timeout after 1s, when calling remote method hello
994
timeout after 1s, when calling remote method hello
995
timeout after 1s, when calling remote method hello
996
timeout after 1s, when calling remote method hello
997
timeout after 1s, when calling remote method hello
998
timeout after 1s, when calling remote method hello
999
timeout after 1s, when calling remote method hello
1000
timeout after 1s, when calling remote method hello
1001
^CKeyboardInterrupt
2021-01-09T06:12:34Z
Traceback (most recent call last):
File "hello_client.py", line 12, in <module>
print c.hello("RPC", async=False)
File "/usr/lib/python2.7/site-packages/zerorpc/core.py", line 283, in <lambda>
return lambda *args, **kargs: self(method, *args, **kargs)
File "/usr/lib/python2.7/site-packages/zerorpc/core.py", line 272, in __call__
bufchan.emit_event(request_event)
File "/usr/lib/python2.7/site-packages/zerorpc/channel.py", line 234, in emit_event
self._channel.emit_event(event)
File "/usr/lib/python2.7/site-packages/zerorpc/heartbeat.py", line 116, in emit_event
self._channel.emit_event(event, timeout)
File "/usr/lib/python2.7/site-packages/zerorpc/channel.py", line 154, in emit_event
self._multiplexer.emit_event(event, timeout)
File "/usr/lib/python2.7/site-packages/zerorpc/channel.py", line 66, in emit_event
return self._events.emit_event(event, timeout)
File "/usr/lib/python2.7/site-packages/zerorpc/events.py", line 360, in emit_event
self._send(parts, timeout)
File "/usr/lib/python2.7/site-packages/zerorpc/events.py", line 136, in __call__
self._send_queue.put(parts, timeout=timeout)
File "src/gevent/queue.py", line 629, in gevent._queue.Channel.put
File "src/gevent/queue.py", line 624, in gevent._queue.Channel.put
File "src/gevent/_waiter.py", line 151, in gevent.__waiter.Waiter.get
File "src/gevent/_greenlet_primitives.py", line 60, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/_greenlet_primitives.py", line 60, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/_greenlet_primitives.py", line 64, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/__greenlet_primitives.pxd", line 35, in gevent.__greenlet_primitives._greenlet_switch
KeyboardInterrupt
any help will appreciated
The text was updated successfully, but these errors were encountered:
This is because the zmq queue is full after 1000 entries. It is a really annoying side effect of zmq. I don't think there is any way out of this sadly. Besides replacing zmq. Or maybe newer version of zmq have a way to clear the queue.
code
the server above is not reachable, it will kept print timeout message, but over 1,000 times, it stuck in gevent.queue.Channel.put()
output
any help will appreciated
The text was updated successfully, but these errors were encountered: