Catch socket.timeout when doing heartbeat_check

heartbeat_check in kombu.connection is not reraising exceptions as
exceptions.OperationalError, and the socket timeout during the heartbeat
check is really an issue seen in the field when a node goes down; the
heartbeat thread just tries again and again to deal with it, without
success.

Change-Id: I26dbdb18a7e64946db2cba676764ff2d428c7897
Closes-Bug: #1657444
(cherry picked from commit 8bfc3637a2)
This commit is contained in:
Vincent Untz 2017-11-14 17:53:32 +01:00
parent a07d852b23
commit ae3de7f37c
1 changed files with 2 additions and 1 deletions

View File

@ -988,7 +988,8 @@ class Connection(object):
self.connection.drain_events(timeout=0.001)
except socket.timeout:
pass
except kombu.exceptions.OperationalError as exc:
except (socket.timeout,
kombu.exceptions.OperationalError) as exc:
LOG.info(_LI("A recoverable connection/channel error "
"occurred, trying to reconnect: %s"), exc)
self.ensure_connection()