Permalink
Browse files

Fix zmq socket.close() with eventlet 0.9.17

A bug/change in eventlet 0.9.17 blocks the
kwargs from close() from passing through
to pyzmq. As this code was only explicitly
passing defaults, no argument is necessary.

This addresses file descriptor leaks reported
in bug 1099185. This bug does not affect
installations with eventlet<=0.9.16

The code will now log an error if a socket
cannot be closed.

Change-Id: Id438dab9744042328b7fac44693d02e116d8c1d9
  • Loading branch information...
1 parent d74668f commit f1b23c8077593334ec8bc94fcb40287b7d31f7a5 Eric Windisch committed Jan 13, 2013
Showing with 7 additions and 3 deletions.
  1. +7 −3 openstack/common/rpc/impl_zmq.py
@@ -185,11 +185,15 @@ def close(self):
pass
self.subscriptions = []
- # Linger -1 prevents lost/dropped messages
try:
- self.sock.close(linger=-1)
+ # Default is to linger
+ self.sock.close()
except Exception:
- pass
+ # While this is a bad thing to happen,
+ # it would be much worse if some of the code calling this
+ # were to fail. For now, lets log, and later evaluate
+ # if we can safely raise here.
+ LOG.error("ZeroMQ socket could not be closed.")
self.sock = None
def recv(self):

0 comments on commit f1b23c8

Please sign in to comment.