)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2758bb4ac8c6aa72c9810359fc3332c14601e624","unresolved":false,"context_lines":[{"line_number":15,"context_line":"greenthreads and oslo.db does a time.sleep to allow switching"},{"line_number":16,"context_line":"greenthreads [2]."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"So, This patch we add the monkey_patch in the uwsgi application"},{"line_number":19,"context_line":"setup."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"[1] https://github.com/openstack/nova/blob/233ea58/nova/cmd/__init__.py#L26"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"3f79a3b5_eb667cbb","line":18,"range":{"start_line":18,"start_character":4,"end_line":18,"end_character":8},"updated":"2018-08-24 12:48:26.000000000","message":"nit: \"in this patch\"","commit_id":"2833af3b6ba4c9d4bdaca802c5f8836df2cab994"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"36ec40338b8301a8fc6fcc70016462e00c51eae0","unresolved":false,"context_lines":[{"line_number":15,"context_line":"greenthreads and oslo.db does a time.sleep to allow switching"},{"line_number":16,"context_line":"greenthreads [2]."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"So, This patch we add the monkey_patch in the uwsgi application"},{"line_number":19,"context_line":"setup."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"[1] https://github.com/openstack/nova/blob/233ea58/nova/cmd/__init__.py#L26"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"3f79a3b5_b69bd270","line":18,"range":{"start_line":18,"start_character":4,"end_line":18,"end_character":8},"in_reply_to":"3f79a3b5_eb667cbb","updated":"2018-08-28 01:52:04.000000000","message":"Done","commit_id":"2833af3b6ba4c9d4bdaca802c5f8836df2cab994"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2758bb4ac8c6aa72c9810359fc3332c14601e624","unresolved":false,"context_lines":[{"line_number":16,"context_line":"greenthreads [2]."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"So, This patch we add the monkey_patch in the uwsgi application"},{"line_number":19,"context_line":"setup."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"[1] https://github.com/openstack/nova/blob/233ea58/nova/cmd/__init__.py#L26"},{"line_number":22,"context_line":"[2] https://github.com/openstack/oslo.db/blob/9c66959/oslo_db/sqlalchemy/engines.py#L51"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"3f79a3b5_4b0bf0d3","line":19,"updated":"2018-08-24 12:48:26.000000000","message":"\"and refactor the monkey patching to use common code.\"","commit_id":"2833af3b6ba4c9d4bdaca802c5f8836df2cab994"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"36ec40338b8301a8fc6fcc70016462e00c51eae0","unresolved":false,"context_lines":[{"line_number":16,"context_line":"greenthreads [2]."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"So, This patch we add the monkey_patch in the uwsgi application"},{"line_number":19,"context_line":"setup."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"[1] https://github.com/openstack/nova/blob/233ea58/nova/cmd/__init__.py#L26"},{"line_number":22,"context_line":"[2] https://github.com/openstack/oslo.db/blob/9c66959/oslo_db/sqlalchemy/engines.py#L51"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"3f79a3b5_d6968e49","line":19,"in_reply_to":"3f79a3b5_4b0bf0d3","updated":"2018-08-28 01:52:04.000000000","message":"Done","commit_id":"2833af3b6ba4c9d4bdaca802c5f8836df2cab994"}],"nova/api/openstack/wsgi_app.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ff7abe5dab55b69a28cdfb23a365569a2c44a80","unresolved":false,"context_lines":[{"line_number":12,"context_line":"\"\"\"WSGI application initialization for Nova APIs.\"\"\""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import os"},{"line_number":15,"context_line":"import eventlet"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from oslo_config import cfg"},{"line_number":18,"context_line":"from oslo_log import log as logging"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_176720eb","line":15,"updated":"2018-08-16 08:16:50.000000000","message":"imports are out of order, pep8 is going to fail; also, eventlet is a 3rd party import so it should be grouped in with oslo and paste imports below.","commit_id":"ec18f11624b608f494dbe2ccdd2dc146596ae437"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"9f722451ce6800b0f02ceaa665d60390ddb254d7","unresolved":false,"context_lines":[{"line_number":12,"context_line":"\"\"\"WSGI application initialization for Nova APIs.\"\"\""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import os"},{"line_number":15,"context_line":"import eventlet"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from oslo_config import cfg"},{"line_number":18,"context_line":"from oslo_log import log as logging"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_0286fdb9","line":15,"in_reply_to":"3f79a3b5_176720eb","updated":"2018-08-16 12:18:25.000000000","message":"Done","commit_id":"ec18f11624b608f494dbe2ccdd2dc146596ae437"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2ff7abe5dab55b69a28cdfb23a365569a2c44a80","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        eventlet.monkey_patch(os\u003dFalse, thread\u003dFalse)"},{"line_number":103,"context_line":"    else:"},{"line_number":104,"context_line":"        eventlet.monkey_patch(os\u003dFalse)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    return deploy.loadapp(\u0027config:%s\u0027 % conf, name\u003dname)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_37a33c02","line":105,"updated":"2018-08-16 08:16:50.000000000","message":"We probably also need this right?\n\nhttps://github.com/openstack/nova/blob/233ea58/nova/cmd/__init__.py#L32\n\nMaybe we should move that code into a common location so we can re-use it here? Or at least add a comment that this is copied from nova/cmd/__init__.py.","commit_id":"ec18f11624b608f494dbe2ccdd2dc146596ae437"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"9f722451ce6800b0f02ceaa665d60390ddb254d7","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        eventlet.monkey_patch(os\u003dFalse, thread\u003dFalse)"},{"line_number":103,"context_line":"    else:"},{"line_number":104,"context_line":"        eventlet.monkey_patch(os\u003dFalse)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    return deploy.loadapp(\u0027config:%s\u0027 % conf, name\u003dname)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_e28ae1bc","line":105,"in_reply_to":"3f79a3b5_37a33c02","updated":"2018-08-16 12:18:25.000000000","message":"Yeah, I move it to nova.utils.","commit_id":"ec18f11624b608f494dbe2ccdd2dc146596ae437"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f3a5d20f6dc2793de45a465487edcbba69f6a78c","unresolved":false,"context_lines":[{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    conf \u003d conf_files[0]"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    utils.monkey_patch()"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    return deploy.loadapp(\u0027config:%s\u0027 % conf, name\u003dname)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_3836c852","line":99,"updated":"2018-08-16 13:20:12.000000000","message":"try putting this at the very top of this file and see if it makes any difference. The _setup_service() function above already is interacting with the API database so I\u0027m not sure whether oslo.db is being properly monkey-patched if you do it here.","commit_id":"40735c6ea33442a9435bffed337c74578700a4a2"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"43e5177a7fddb88fbca3107f3f86a11878ae9e05","unresolved":false,"context_lines":[{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    conf \u003d conf_files[0]"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    utils.monkey_patch()"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    return deploy.loadapp(\u0027config:%s\u0027 % conf, name\u003dname)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_40e85b7b","line":99,"in_reply_to":"3f79a3b5_3836c852","updated":"2018-08-17 03:46:06.000000000","message":"Yeah, we can put it before L32.","commit_id":"40735c6ea33442a9435bffed337c74578700a4a2"}],"nova/utils.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"87b2483a28cb6c132c04ad431c7331ac4473a796","unresolved":false,"context_lines":[{"line_number":1311,"context_line":"    # which keeps the request context for the current thread. If oslo.context is"},{"line_number":1312,"context_line":"    # imported before calling monkey_patch(), then this thread-local won\u0027t be"},{"line_number":1313,"context_line":"    # green. To workaround this, reload the module after calling monkey_patch()"},{"line_number":1314,"context_line":"    reload_module(importutils.import_module(\u0027oslo_context.context\u0027))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_58f2a471","line":1314,"updated":"2018-08-16 13:25:44.000000000","message":"perhaps the oslo_db.sqlalchemy.enginefacade module also needs to be reloaded in the same fashion because it, too, keeps thread-local state:\n\nhttps://github.com/openstack/oslo.db/blob/master/oslo_db/sqlalchemy/enginefacade.py#L731\n\nI\u0027m not sure whether doing this monkey-patching within a utility function is appropriate though, versus doing the monkey-patching first thing in the wsgi app initializing module.","commit_id":"40735c6ea33442a9435bffed337c74578700a4a2"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"43e5177a7fddb88fbca3107f3f86a11878ae9e05","unresolved":false,"context_lines":[{"line_number":1311,"context_line":"    # which keeps the request context for the current thread. If oslo.context is"},{"line_number":1312,"context_line":"    # imported before calling monkey_patch(), then this thread-local won\u0027t be"},{"line_number":1313,"context_line":"    # green. To workaround this, reload the module after calling monkey_patch()"},{"line_number":1314,"context_line":"    reload_module(importutils.import_module(\u0027oslo_context.context\u0027))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_2611b854","line":1314,"in_reply_to":"3f79a3b5_58f2a471","updated":"2018-08-17 03:46:06.000000000","message":"\u003e perhaps the oslo_db.sqlalchemy.enginefacade module also needs to be reloaded in the same fashion because it, too, keeps thread-local state:\n\nSorry, I\u0027m not familiar with oslo_db.sqlalchemy.enginfacade, I just extract something common from __init__ to utils, and call it in wsgi or uwsgi mode, if we need it, I can do it in follow patch.\n\n\u003e I\u0027m not sure whether doing this monkey-patching within a utility function is appropriate though, versus doing the monkey-patching first thing in the wsgi app initializing module.\n\nSo, you mean we can do monkey-patching in [1] rather than [2]?\n\n[1] https://github.com/openstack/nova/blob/master/nova/service.py#L316\n[2] https://review.openstack.org/#/c/592285/4/nova/cmd/__init__.py@18","commit_id":"40735c6ea33442a9435bffed337c74578700a4a2"}]}
