From fb732971129444b5d0fb91be2340f91d7454fc4a Mon Sep 17 00:00:00 2001 From: Davanum Srinivas <davanum@gmail.com> Date: Fri, 11 Mar 2016 12:15:49 -0500 Subject: [PATCH] Fix Notification listener blocking behavior Add a sleep() to allow other threads (like the one collecting the stats) to run. Closes-Bug: #1555632 Change-Id: I6fcb63c10acd76f2815e23fbd303f08974feb993 --- oslo_messaging/_drivers/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oslo_messaging/_drivers/base.py b/oslo_messaging/_drivers/base.py index 456ffeb25..073f8555d 100644 --- a/oslo_messaging/_drivers/base.py +++ b/oslo_messaging/_drivers/base.py @@ -14,6 +14,7 @@ # under the License. import abc +import time from oslo_config import cfg from oslo_utils import timeutils @@ -51,6 +52,7 @@ def batch_poll_helper(func): else: # timeout reached or listener stopped break + time.sleep(0) return incomings return wrapper