Moved eventlet monkey_patch before app is imported
In cmd/api.py the eventlet monkey_patch has been moved to be before api app import. This is because if it's called too late, the api app and db api module will be loaded without awareness of eventlet, the threading local context in db api won't be eventlet compatible, causing DB parallel operation errors. Change-Id: I294657fc910c6a4696f91308d60697d005dc53b0 Closes-Bug: 1846411 Signed-off-by: Andy Ning <andy.ning@windriver.com>
This commit is contained in:
parent
36702d225c
commit
3e2eccea4a
@ -25,6 +25,8 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
|
eventlet.monkey_patch(os=False)
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_service import systemd
|
from oslo_service import systemd
|
||||||
@ -41,7 +43,6 @@ from dcdbsync.common import messaging
|
|||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
config.register_options()
|
config.register_options()
|
||||||
LOG = logging.getLogger('dcdbsync.api')
|
LOG = logging.getLogger('dcdbsync.api')
|
||||||
eventlet.monkey_patch(os=False)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
|
eventlet.monkey_patch(os=False)
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_service import systemd
|
from oslo_service import systemd
|
||||||
@ -43,7 +45,6 @@ from dcorch.common import messaging as dcorch_messaging
|
|||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
config.register_options()
|
config.register_options()
|
||||||
LOG = logging.getLogger('dcmanager.api')
|
LOG = logging.getLogger('dcmanager.api')
|
||||||
eventlet.monkey_patch(os=False)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
|
eventlet.monkey_patch(os=False)
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_service import systemd
|
from oslo_service import systemd
|
||||||
@ -36,7 +38,6 @@ from dcorch.common import messaging
|
|||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
config.register_options()
|
config.register_options()
|
||||||
LOG = logging.getLogger('dcorch.api')
|
LOG = logging.getLogger('dcorch.api')
|
||||||
eventlet.monkey_patch(os=False)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
|
eventlet.monkey_patch(os=False)
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_service import systemd
|
from oslo_service import systemd
|
||||||
@ -58,7 +60,6 @@ config.register_options()
|
|||||||
CONF.register_cli_opts(proxy_cli_opts)
|
CONF.register_cli_opts(proxy_cli_opts)
|
||||||
|
|
||||||
LOG = logging.getLogger('dcorch.api.proxy')
|
LOG = logging.getLogger('dcorch.api.proxy')
|
||||||
eventlet.monkey_patch(os=False)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
Reference in New Issue
Block a user