diff options
author | Eric Windisch <eric@cloudscaling.com> | 2013-01-13 14:11:49 -0500 |
---|---|---|
committer | Eric Windisch <eric@cloudscaling.com> | 2013-01-13 15:53:47 -0500 |
commit | f1b23c8077593334ec8bc94fcb40287b7d31f7a5 (patch) | |
tree | db50a62ee5239115691f8047cfa376033bf8f5aa | |
parent | d74668fbedc29aa4b7868fd3fb8a28d326f43d52 (diff) | |
download | oslo-f1b23c8077593334ec8bc94fcb40287b7d31f7a5.tar.gz oslo-f1b23c8077593334ec8bc94fcb40287b7d31f7a5.tar.xz oslo-f1b23c8077593334ec8bc94fcb40287b7d31f7a5.zip |
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
-rw-r--r-- | openstack/common/rpc/impl_zmq.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py index d595212..c5f37c1 100644 --- a/openstack/common/rpc/impl_zmq.py +++ b/openstack/common/rpc/impl_zmq.py @@ -185,11 +185,15 @@ class ZmqSocket(object): 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): |