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:
parent
f31640dc87
commit
3accbf3c80
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue