Use Python's threading.semaphore to avoid eventlet deadlocks.

Using eventlet.semaphore.Semaphore causes periodic deadlocks for AMQP
connection pool establishment (specifically, as the state machine asks for
Neutron Router details via the "sync_routers" AMQP call).  The state machine
worker threads are not monkey-patched green threads (they're native Python
threads), so we should just be using a threading.Semaphore here.

Change-Id: Id4f370259c0deca4b635319b7302d1c475e7b3fe
This commit is contained in:
Ryan Petrello 2016-02-18 15:51:58 -05:00
parent f31640dc87
commit 3accbf3c80
1 changed files with 2 additions and 1 deletions

View File

@ -45,6 +45,7 @@ AMQP, but is deprecated and predates this code.
import collections
import inspect
import sys
import threading
import uuid
from eventlet import greenpool
@ -107,7 +108,7 @@ class Pool(pools.Pool):
self.connection_cls.pool = None
_pool_create_sem = semaphore.Semaphore()
_pool_create_sem = threading.Semaphore()
def get_connection_pool(conf, connection_cls):