From 474a4be4062de4546632a3104a69bf8f6a60e0ba Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Wed, 7 Dec 2016 15:29:23 -0800 Subject: [PATCH] Qpid: Use monotonic time for drain_events timeout --- kombu/transport/qpid.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kombu/transport/qpid.py b/kombu/transport/qpid.py index 756b0ef0..22046241 100644 --- a/kombu/transport/qpid.py +++ b/kombu/transport/qpid.py @@ -84,7 +84,6 @@ import select import socket import ssl import sys -import time import uuid from gettext import gettext as _ @@ -117,7 +116,7 @@ except ImportError: # pragma: no cover qpid = None -from kombu.five import Empty, items +from kombu.five import Empty, items, monotonic from kombu.log import get_logger from kombu.transport.virtual import Base64, Message from kombu.transport import base @@ -1680,7 +1679,7 @@ class Transport(base.Transport): :type timeout: int """ - start_time = time.time() + start_time = monotonic() elapsed_time = -1 while elapsed_time < timeout: try: @@ -1691,7 +1690,7 @@ class Transport(base.Transport): raise socket.timeout() else: connection._callbacks[queue](message) - elapsed_time = time.time() - start_time + elapsed_time = monotonic() - start_time raise socket.timeout() def create_channel(self, connection):