Merge "Reload oslo_context after calling monkey_patch()"
This commit is contained in:
@@ -14,6 +14,8 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
|
from oslo_utils import importutils
|
||||||
|
from six.moves import reload_module
|
||||||
|
|
||||||
from nova import debugger
|
from nova import debugger
|
||||||
|
|
||||||
@@ -22,3 +24,9 @@ if debugger.enabled():
|
|||||||
eventlet.monkey_patch(os=False, thread=False)
|
eventlet.monkey_patch(os=False, thread=False)
|
||||||
else:
|
else:
|
||||||
eventlet.monkey_patch(os=False)
|
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'))
|
||||||
|
Reference in New Issue
Block a user