Merge "Reload oslo_context after calling monkey_patch()"
This commit is contained in:
commit
f9ad40d35d
@ -14,6 +14,8 @@
|
||||
# under the License.
|
||||
|
||||
import eventlet
|
||||
from oslo_utils import importutils
|
||||
from six.moves import reload_module
|
||||
|
||||
from nova import debugger
|
||||
|
||||
@ -22,3 +24,9 @@ if debugger.enabled():
|
||||
eventlet.monkey_patch(os=False, thread=False)
|
||||
else:
|
||||
eventlet.monkey_patch(os=False)
|
||||
|
||||
# NOTE(rgerganov): oslo.context is storing a global thread-local variable
|
||||
# which keeps the request context for the current thread. If oslo.context is
|
||||
# imported before calling monkey_patch(), then this thread-local won't be
|
||||
# green. To workaround this, reload the module after calling monkey_patch()
|
||||
reload_module(importutils.import_module('oslo_context.context'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user