)]}'
{"nova/api/openstack/wsgi_app.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"93a45ff37bf746f65a8fc1d42213bb46df4bef40","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    conf_files \u003d _get_config_files()"},{"line_number":76,"context_line":"    # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn\u0027t"},{"line_number":77,"context_line":"    # already contain registered options if the app is reloaded."},{"line_number":78,"context_line":"    CONF.reset()"},{"line_number":79,"context_line":"    config.parse_args([], default_config_files\u003dconf_files)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    logging.setup(CONF, \"nova\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_77c5390a","line":78,"updated":"2020-06-11 23:51:37.000000000","message":"I think this change makes sense but can\u0027t help but think we need to add some kind of unit test for init_application at this point.\n\nThis change made me realize that we need to re-init a few other things here too as well, like our global cell cache and service version cache. And when we add those we should add some verification to the same unit test.","commit_id":"58c09b8e8d2792a5b1393f4dc00c0ce7b6913c02"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"a81172339b8bb3f2a1227c68ebfa8653b05ce747","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    conf_files \u003d _get_config_files()"},{"line_number":76,"context_line":"    # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn\u0027t"},{"line_number":77,"context_line":"    # already contain registered options if the app is reloaded."},{"line_number":78,"context_line":"    CONF.reset()"},{"line_number":79,"context_line":"    config.parse_args([], default_config_files\u003dconf_files)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    logging.setup(CONF, \"nova\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf51134e_bb5fdd0c","line":78,"in_reply_to":"bf51134e_0a27a066","updated":"2020-07-02 22:17:20.000000000","message":"\u003e When we start the nova-api  on wsgi mode we always need the db\n \u003e first because the nova config module  will always try to connect to\n \u003e it [2]. This is due to the fact that  `configure_db` is set to True\n \u003e as the default value and we use this default value under the wsgi\n \u003e mode [3].\n\nYes that sounds correct to me.\n\n \u003e Previously (around OSP13 IIRC) a script was introduced to wait for\n \u003e the db before starting nova-api [2], this one was related to\n \u003e migration/sync and maybe we should take care to this scenario too,\n \u003e I mean waiting for the db first and then start nova in wsgi mode,\n \u003e (I\u0027ve no ideas about the nova workflow and its needs). The\n \u003e rationale behind this script [2][5] really look like similar to our\n \u003e current issue - the db issue - unfortunatelly this script is only\n \u003e for nova-placement and also I noticed that another script [6] is\n \u003e used to wait for compute but it doesn t take care about db service.\n \u003e \n \u003e Are we sure we need the db during the config loading on wsgi mode?\n \u003e If yes then we should ensure that services are properly prioritized\n \u003e at start.\n\nI think we do yes, similar to placement.\n\n \u003e Are we saying that unless we disable this db loading config option,\n \u003e we need to guarantee the db is up *before* nova_api starts?.\n \u003e Because in theory we overcame this very thing with the following\n \u003e two options [nova.conf]:\n \u003e # Maximum number of database connection retries during startup. Set\n \u003e to -1 to\n \u003e max_retries\u003d-1\n \u003e # raised. Set to -1 to specify an infinite retry count. (integer\n \u003e value)\n \u003e db_max_retries\u003d-1 [shortcut approach -\n \u003e \n \u003e I think we should take example on the nova-placement config since\n \u003e python codes are mostly similar and `configure_db` is `True` there\n \u003e too, so I suppose they/we already fixed that point here.\n\nRight. I took a look at the placement code and find this is how they have handled the scenario of reloading the wsgi application without restarting the process, with a @run_once decorator [1].\n\n \u003e If not then we just have to pass `False` from the `wsgi_app` module\n \u003e ot move away from this scenario.\n\nWe do need the database to do anything in nova, so we do want to pass True for a true application start. You are right that we could do something similar to placement (like @run_once), but that is assuming no other \"gotchas\" around global nova state that should be reset. If we miss some cases, we will still suffer problems, likely ones that are more hidden and harder to debug. Just a word of warning on this approach. We have a lot of similarity with placement but unfortunately we have more complexity too and more global state.\n\n \u003e I\u0027ve no ideas about the restart of the containers, IIRC it was\n \u003e during an update so I suppose the restart come from some tripleo\n \u003e things.\n\nYes, completely agree that the restart of containers would be a tripleo thing. My concern is that we might go on a hunt to reset all global states in nova and still miss some and still end up with problems (potentially hidden ones) in this reload-but-not-restart scenario and that it might be best to investigate the issue on the tripleo side as well, because the changes we try in nova will not be guaranteed to give us the fresh slate we need to work properly after a reload-but-not-restart. When overcloud nodes are rebooted, I really thought they should involve restarting the containers.\n\n[1] https://github.com/openstack/placement/blob/2009e61335a43645e5d191546dbdc94709b221cd/placement/db_api.py#L32","commit_id":"58c09b8e8d2792a5b1393f4dc00c0ce7b6913c02"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"4d85be5b3e99e32238a45ef0392c46268589a4e8","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    conf_files \u003d _get_config_files()"},{"line_number":76,"context_line":"    # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn\u0027t"},{"line_number":77,"context_line":"    # already contain registered options if the app is reloaded."},{"line_number":78,"context_line":"    CONF.reset()"},{"line_number":79,"context_line":"    config.parse_args([], default_config_files\u003dconf_files)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    logging.setup(CONF, \"nova\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf51134e_0a27a066","line":78,"in_reply_to":"bf51134e_331dd8bd","updated":"2020-07-02 12:54:07.000000000","message":"No problem for your delayed response :)\n\nIndeed, few weeks ago we also faced the db error when we fixed CONF issue [1] (these changes), but we choosen to fix issues ones by ones as it is different things to solve.\n\nwe thought that db issue was hidden by the config issue. Previously we failed due to args that are registered twice because arguments were already parsed before. Now we goes away from the already parsed args and this error looks like to a race condition.\n\nIt looks a bit to:\n- https://bugzilla.redhat.com/show_bug.cgi?id\u003d1643147 \n- https://bugzilla.redhat.com/show_bug.cgi?id\u003d1636399\n\nWhen we start the nova-api  on wsgi mode we always need the db first because the nova config module  will always try to connect to it [2]. This is due to the fact that  `configure_db` is set to True as the default value and we use this default value under the wsgi mode [3].\n\nPreviously (around OSP13 IIRC) a script was introduced to wait for the db before starting nova-api [2], this one was related to migration/sync and maybe we should take care to this scenario too, I mean waiting for the db first and then start nova in wsgi mode, (I\u0027ve no ideas about the nova workflow and its needs). The rationale behind this script [2][5] really look like similar to our current issue - the db issue - unfortunatelly this script is only for nova-placement and also I noticed that another script [6] is used to wait for compute but it doesn t take care about db service.\n\nAre we sure we need the db during the config loading on wsgi mode?\nIf yes then we should ensure that services are properly prioritized at start.\nAre we saying that unless we disable this db loading config option, we need to guarantee the db is up *before* nova_api starts?.\nBecause in theory we overcame this very thing with the following two options [nova.conf]:\n# Maximum number of database connection retries during startup. Set to -1 to \nmax_retries\u003d-1\n# raised. Set to -1 to specify an infinite retry count. (integer value)\ndb_max_retries\u003d-1 [shortcut approach - \n\nI think we should take example on the nova-placement config since python codes are mostly similar and `configure_db` is `True` there too, so I suppose they/we already fixed that point here.\n\nIf not then we just have to pass `False` from the `wsgi_app` module ot move away from this scenario.\n\nI\u0027ve no ideas about the restart of the containers, IIRC it was during an update so I suppose the restart come from some tripleo things.\n\nThoughts?\n\n[1] \n```\n[Thu Jun 04 12:54:07.463265 2020] [:error] [pid 17] [remote 172.17.1.36:200] mod_wsgi (pid\u003d17): Target WSGI script \u0027/var/www/cgi-bin/nova/nova-api\u0027 cannot be loaded as Python module.\n[Thu Jun 04 12:54:07.463295 2020] [:error] [pid 17] [remote 172.17.1.36:200] mod_wsgi (pid\u003d17): Exception occurred processing WSGI script \u0027/var/www/cgi-bin/nova/nova-api\u0027.\n[Thu Jun 04 12:54:07.463312 2020] [:error] [pid 17] [remote 172.17.1.36:200] Traceback (most recent call last):\n[Thu Jun 04 12:54:07.463334 2020] [:error] [pid 17] [remote 172.17.1.36:200]   File \"/var/www/cgi-bin/nova/nova-api\", line 54, in \u003cmodule\u003e\n[Thu Jun 04 12:54:07.463376 2020] [:error] [pid 17] [remote 172.17.1.36:200]     application \u003d init_application()\n[Thu Jun 04 12:54:07.463386 2020] [:error] [pid 17] [remote 172.17.1.36:200]   File \"/usr/lib/python2.7/site-packages/nova/api/openstack/compute/wsgi.py\", line 20, in init_application\n[Thu Jun 04 12:54:07.463407 2020] [:error] [pid 17] [remote 172.17.1.36:200]     return wsgi_app.init_application(NAME)\n[Thu Jun 04 12:54:07.463414 2020] [:error] [pid 17] [remote 172.17.1.36:200]   File \"/usr/lib/python2.7/site-packages/nova/api/openstack/wsgi_app.py\", line 81, in init_application\n[Thu Jun 04 12:54:07.463427 2020] [:error] [pid 17] [remote 172.17.1.36:200]     config.parse_args([], default_config_files\u003dconf_files)\n[Thu Jun 04 12:54:07.463433 2020] [:error] [pid 17] [remote 172.17.1.36:200]   File \"/usr/lib/python2.7/site-packages/nova/config.py\", line 63, in parse_args\n[Thu Jun 04 12:54:07.463445 2020] [:error] [pid 17] [remote 172.17.1.36:200]     sqlalchemy_api.configure(CONF)\n[Thu Jun 04 12:54:07.463451 2020] [:error] [pid 17] [remote 172.17.1.36:200]   File \"/usr/lib/python2.7/site-packages/nova/db/sqlalchemy/api.py\", line 101, in configure\n[Thu Jun 04 12:54:07.463487 2020] [:error] [pid 17] [remote 172.17.1.36:200]     main_context_manager.configure(**_get_db_conf(conf.database))\n[Thu Jun 04 12:54:07.463499 2020] [:error] [pid 17] [remote 172.17.1.36:200]   File \"/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py\", line 783, in configure\n[Thu Jun 04 12:54:07.463517 2020] [:error] [pid 17] [remote 172.17.1.36:200]     self._factory.configure(**kw)\n[Thu Jun 04 12:54:07.463523 2020] [:error] [pid 17] [remote 172.17.1.36:200]   File \"/usr/lib/python2.7/site-packages/debtcollector/renames.py\", line 43, in decorator\n[Thu Jun 04 12:54:07.463536 2020] [:error] [pid 17] [remote 172.17.1.36:200]     return wrapped(*args, **kwargs)\n[Thu Jun 04 12:54:07.463542 2020] [:error] [pid 17] [remote 172.17.1.36:200]   File \"/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py\", line 307, in configure\n[Thu Jun 04 12:54:07.463553 2020] [:error] [pid 17] [remote 172.17.1.36:200]     self._configure(False, kw)\n[Thu Jun 04 12:54:07.463558 2020] [:error] [pid 17] [remote 172.17.1.36:200]   File \"/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py\", line 312, in _configure\n[Thu Jun 04 12:54:07.463569 2020] [:error] [pid 17] [remote 172.17.1.36:200]     raise TypeError(\"this TransactionFactory is already started\")\n[Thu Jun 04 12:54:07.463583 2020] [:error] [pid 17] [remote 172.17.1.36:200] TypeError: this TransactionFactory is already started\n```\n[2] https://code.engineering.redhat.com/gerrit/#/c/156817/3/docker_config_scripts/nova_wait_for_db_sync.py\n[3] https://github.com/openstack/nova/blob/stable/queens/nova/config.py#L62 \n[4] https://github.com/openstack/nova/blob/stable/queens/nova/api/openstack/wsgi_app.py#L78    \n[5] https://review.opendev.org/#/c/623227/\n[6] https://github.com/openstack/tripleo-heat-templates/blob/stable/queens/docker/services/nova-compute.yaml#L274\n[7] https://github.com/openstack/tripleo-heat-templates/blob/stable/queens/docker_config_scripts/nova_wait_for_compute_service.py","commit_id":"58c09b8e8d2792a5b1393f4dc00c0ce7b6913c02"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"54f3cbdfc38caf7c8b50b634698534c34ff68102","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    conf_files \u003d _get_config_files()"},{"line_number":76,"context_line":"    # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn\u0027t"},{"line_number":77,"context_line":"    # already contain registered options if the app is reloaded."},{"line_number":78,"context_line":"    CONF.reset()"},{"line_number":79,"context_line":"    config.parse_args([], default_config_files\u003dconf_files)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    logging.setup(CONF, \"nova\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf51134e_331dd8bd","line":78,"in_reply_to":"bf51134e_64489e86","updated":"2020-07-01 01:14:10.000000000","message":"Apologies for the delayed response -- I got pulled into several downstream issues the past week.\n\nI spent some time today trying out this change in a unit testing environment and what I\u0027ve found so far is that this change will not really solve the problem of the nova-api wsgi application being reloaded but not restarted.\n\nI found that without the CONF.reset(), we hit the error as described in the bug:\n\n oslo_config.cfg.ArgsAlreadyParsedError: arguments already parsed: cannot register CLI option\n\nHowever, with the CONF.reset(), we hit a new error:\n\n oslo_db.sqlalchemy.enginefacade.AlreadyStartedError: this TransactionFactory is already started\n\nwhich is a problem of trying to re-initialize global oslo.db state without restarting the process.\n\nSo, I wanted to pause and ask at this point, has this change been tested anywhere and verified to work to enable the wsgi app to be reloaded? Because from what I have tried so far, it will not solve the problem and the problem then moves to a new place in the code.\n\nWe have a substantial amount of global state in nova that may not work properly to be re-initialized without restarting the nova process, so I\u0027m beginning to think that this may not be a reasonable approach for solving the original issue you encountered.\n\nI think there are some unanswered questions around the behavior of the nova_api containers in this scenario. When a node is rebooted, how/why are the containers not restarted? Is this intentional or is there a bug related to the containers not being restarted? I think we should explore this a bit to fully understand what is happening and where the fix needs to be made.","commit_id":"58c09b8e8d2792a5b1393f4dc00c0ce7b6913c02"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"0b3840ddcdd230e4301d34f4d44c24f00228b2f9","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    conf_files \u003d _get_config_files()"},{"line_number":76,"context_line":"    # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn\u0027t"},{"line_number":77,"context_line":"    # already contain registered options if the app is reloaded."},{"line_number":78,"context_line":"    CONF.reset()"},{"line_number":79,"context_line":"    config.parse_args([], default_config_files\u003dconf_files)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    logging.setup(CONF, \"nova\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_fa101052","line":78,"in_reply_to":"ff570b3c_77c5390a","updated":"2020-06-12 00:16:11.000000000","message":"Thinking about it more, I think the cell cache and service version re-init should be part of this patch because it\u0027s part of the same issue of the wsgi app being reloaded and properly re-initialized. I will add that part and add a unit test for the re-inits.","commit_id":"58c09b8e8d2792a5b1393f4dc00c0ce7b6913c02"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"7d114d1d19e4de05dfe21760e68b67f2b40b87c8","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    conf_files \u003d _get_config_files()"},{"line_number":76,"context_line":"    # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn\u0027t"},{"line_number":77,"context_line":"    # already contain registered options if the app is reloaded."},{"line_number":78,"context_line":"    CONF.reset()"},{"line_number":79,"context_line":"    config.parse_args([], default_config_files\u003dconf_files)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    logging.setup(CONF, \"nova\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"bf51134e_64489e86","line":78,"in_reply_to":"ff570b3c_fa101052","updated":"2020-06-23 10:20:40.000000000","message":"Thanks Melanie for your feedback, lets me know if I can help you by doing some reviews or submitting some patches or related changes.","commit_id":"58c09b8e8d2792a5b1393f4dc00c0ce7b6913c02"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"db1ffd4fd527833d2541099d363fa350bffbbd59","unresolved":true,"context_lines":[{"line_number":77,"context_line":"    return application"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"@utils.run_once(\u0027Global data already initialized, not re-initializing.\u0027,"},{"line_number":81,"context_line":"                LOG.info)"},{"line_number":82,"context_line":"def init_global_data(conf_files):"},{"line_number":83,"context_line":"    # NOTE(melwitt): parse_args initializes logging and calls global rpc.init()"}],"source_content_type":"text/x-python","patch_set":6,"id":"f7541fe4_0c77323f","line":80,"range":{"start_line":80,"start_character":1,"end_line":80,"end_character":15},"updated":"2021-03-23 14:36:06.000000000","message":"I know this works and is based on placement stuff, but a simple global variable would have done the same thing too","commit_id":"7c9edc02eda45aafbbb539b759e6b92f7aeb5ea8"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7b1b75108af6c587952744f839e18b381dfe6a60","unresolved":true,"context_lines":[{"line_number":77,"context_line":"    return application"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"@utils.run_once(\u0027Global data already initialized, not re-initializing.\u0027,"},{"line_number":81,"context_line":"                LOG.info)"},{"line_number":82,"context_line":"def init_global_data(conf_files):"},{"line_number":83,"context_line":"    # NOTE(melwitt): parse_args initializes logging and calls global rpc.init()"}],"source_content_type":"text/x-python","patch_set":6,"id":"05a5a265_4cab20b9","line":80,"range":{"start_line":80,"start_character":1,"end_line":80,"end_character":15},"in_reply_to":"5875e00d_2ebcac0e","updated":"2021-04-01 00:33:37.000000000","message":"Sorry y\u0027all, I thought copying the placement method would have been most liked by reviewers :(","commit_id":"7c9edc02eda45aafbbb539b759e6b92f7aeb5ea8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"de9c6b522a69a4f9b9fe6858965457768bf78c39","unresolved":true,"context_lines":[{"line_number":77,"context_line":"    return application"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"@utils.run_once(\u0027Global data already initialized, not re-initializing.\u0027,"},{"line_number":81,"context_line":"                LOG.info)"},{"line_number":82,"context_line":"def init_global_data(conf_files):"},{"line_number":83,"context_line":"    # NOTE(melwitt): parse_args initializes logging and calls global rpc.init()"}],"source_content_type":"text/x-python","patch_set":6,"id":"5875e00d_2ebcac0e","line":80,"range":{"start_line":80,"start_character":1,"end_line":80,"end_character":15},"in_reply_to":"7c08da44_bee09386","updated":"2021-03-24 10:53:06.000000000","message":"Naked or not a global is a global, that causes trouble in testing. See https://bugs.launchpad.net/nova/+bug/1921098 \n\nI prefer explicit over implicit. This is now an implicit global which makes it hard to notice that we are manipulating global state here.","commit_id":"7c9edc02eda45aafbbb539b759e6b92f7aeb5ea8"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"ae6a837fdc1827f3007ee0d303e1b2de8332af31","unresolved":true,"context_lines":[{"line_number":77,"context_line":"    return application"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"@utils.run_once(\u0027Global data already initialized, not re-initializing.\u0027,"},{"line_number":81,"context_line":"                LOG.info)"},{"line_number":82,"context_line":"def init_global_data(conf_files):"},{"line_number":83,"context_line":"    # NOTE(melwitt): parse_args initializes logging and calls global rpc.init()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7c08da44_bee09386","line":80,"range":{"start_line":80,"start_character":1,"end_line":80,"end_character":15},"in_reply_to":"f7541fe4_0c77323f","updated":"2021-03-23 17:42:34.000000000","message":"it would but naked global state is bad for testing and maintainablity.\nyou are correct it could just eb a module levle varable with an early return.\ni just dont think its good to proliferate that pattern in the code bases.","commit_id":"7c9edc02eda45aafbbb539b759e6b92f7aeb5ea8"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"db1ffd4fd527833d2541099d363fa350bffbbd59","unresolved":true,"context_lines":[{"line_number":118,"context_line":"        return error_application(exc, name)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    # This global init is safe because if we got here, we already successfully"},{"line_number":121,"context_line":"    # set up the service and setting up the profile cannot fail."},{"line_number":122,"context_line":"    service.setup_profiler(name, CONF.host)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    conf \u003d conf_files[0]"}],"source_content_type":"text/x-python","patch_set":6,"id":"2f61d250_10acd52d","line":121,"range":{"start_line":121,"start_character":52,"end_line":121,"end_character":58},"updated":"2021-03-23 14:36:06.000000000","message":"should not\n\nanything _could_ fail","commit_id":"7c9edc02eda45aafbbb539b759e6b92f7aeb5ea8"}],"nova/tests/unit/api/openstack/test_wsgi_app.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"f78a922104a6e715b5c05de597ce030f8e23c675","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        mock_setup.side_effect \u003d [test.TestingException, None]"},{"line_number":64,"context_line":"        # Simulate an exception being raised the first time init_application"},{"line_number":65,"context_line":"        # runs"},{"line_number":66,"context_line":"        self.assertRaises(test.TestingException, wsgi_app.init_application,"},{"line_number":67,"context_line":"                          \u0027nova-api\u0027)"},{"line_number":68,"context_line":"        # When init_application is re-run, it should succeed"},{"line_number":69,"context_line":"        wsgi_app.init_application(\u0027nova-api\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_d01354b6","line":66,"range":{"start_line":66,"start_character":49,"end_line":66,"end_character":75},"updated":"2020-10-06 11:14:15.000000000","message":"oh sorry i did not see this call here.\ni tought 62 and 63 where settign up mocking for line 69\n\nya this is what i was expecting to see.","commit_id":"d46e2b4d9fe7a168a8cdaac563dc64df0ac016a2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"dda908c65c67a362aa246f4dce5f77ea8d5d670b","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        # runs"},{"line_number":66,"context_line":"        self.assertRaises(test.TestingException, wsgi_app.init_application,"},{"line_number":67,"context_line":"                          \u0027nova-api\u0027)"},{"line_number":68,"context_line":"        # When init_application is re-run, it should succeed"},{"line_number":69,"context_line":"        wsgi_app.init_application(\u0027nova-api\u0027)"},{"line_number":70,"context_line":"        self.assertIn(\u0027Global data already initialized, not re-initializing.\u0027,"},{"line_number":71,"context_line":"                      self.stdlog.logger.output)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_27b6e1fa","line":71,"range":{"start_line":68,"start_character":6,"end_line":71,"end_character":48},"updated":"2020-10-05 20:54:23.000000000","message":"we could also call this twice right?","commit_id":"d46e2b4d9fe7a168a8cdaac563dc64df0ac016a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"bacb877ac89ba3fd5a8ae4d2e4d2cc4ff9b62fd3","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        # runs"},{"line_number":66,"context_line":"        self.assertRaises(test.TestingException, wsgi_app.init_application,"},{"line_number":67,"context_line":"                          \u0027nova-api\u0027)"},{"line_number":68,"context_line":"        # When init_application is re-run, it should succeed"},{"line_number":69,"context_line":"        wsgi_app.init_application(\u0027nova-api\u0027)"},{"line_number":70,"context_line":"        self.assertIn(\u0027Global data already initialized, not re-initializing.\u0027,"},{"line_number":71,"context_line":"                      self.stdlog.logger.output)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_674d79c4","line":71,"range":{"start_line":68,"start_character":6,"end_line":71,"end_character":48},"in_reply_to":"9f560f44_27b6e1fa","updated":"2020-10-05 21:30:20.000000000","message":"Sorry what do you mean? We call init_application the first time on L66 and the second time on L69. Are you asking something about the logging?","commit_id":"d46e2b4d9fe7a168a8cdaac563dc64df0ac016a2"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"857b5265480ec1c4355d9fac6faca817beb23f2a","unresolved":true,"context_lines":[{"line_number":41,"context_line":"        self.conf.seek(0)"},{"line_number":42,"context_line":"        self.conf.flush()"},{"line_number":43,"context_line":"        # Use of this fixture takes care of isolating registration of config"},{"line_number":44,"context_line":"        # options from other tests running in parallel."},{"line_number":45,"context_line":"        self.useFixture(config_fixture.Config())"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def tearDown(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"64159f1e_1c339e50","line":44,"range":{"start_line":44,"start_character":35,"end_line":44,"end_character":55},"updated":"2020-11-23 11:38:57.000000000","message":"nit: the problem is not the parallel tests, those are running in separate processes and therefore in separate interpreters. The problem is with tests run in this process before this test and after this test","commit_id":"7aa710dd515cbd5b65fa48672891451a9e595911"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e40d5ef5e15da0b175c1f65c7dedfe5c7cdecd76","unresolved":true,"context_lines":[{"line_number":41,"context_line":"        self.conf.seek(0)"},{"line_number":42,"context_line":"        self.conf.flush()"},{"line_number":43,"context_line":"        # Use of this fixture takes care of isolating registration of config"},{"line_number":44,"context_line":"        # options from other tests running in parallel."},{"line_number":45,"context_line":"        self.useFixture(config_fixture.Config())"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def tearDown(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9969640d_4a94008e","line":44,"range":{"start_line":44,"start_character":35,"end_line":44,"end_character":55},"in_reply_to":"64159f1e_1c339e50","updated":"2020-12-14 20:37:50.000000000","message":"I realized this some time after writing it. /me is embarrassed. Will fix these comments.","commit_id":"7aa710dd515cbd5b65fa48672891451a9e595911"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"857b5265480ec1c4355d9fac6faca817beb23f2a","unresolved":true,"context_lines":[{"line_number":45,"context_line":"        self.useFixture(config_fixture.Config())"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def tearDown(self):"},{"line_number":48,"context_line":"        self.conf.close()"},{"line_number":49,"context_line":"        super(WSGIAppTest, self).tearDown()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    @mock.patch(\u0027nova.db.sqlalchemy.api.configure\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"d5b28201_27f0e842","line":48,"updated":"2020-11-23 11:38:57.000000000","message":"to avoid leaking the temp file in case of a failed test you need to add this to the cleanup list via:\n\n  self.addCleanup(self.conf.close)","commit_id":"7aa710dd515cbd5b65fa48672891451a9e595911"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e40d5ef5e15da0b175c1f65c7dedfe5c7cdecd76","unresolved":true,"context_lines":[{"line_number":45,"context_line":"        self.useFixture(config_fixture.Config())"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def tearDown(self):"},{"line_number":48,"context_line":"        self.conf.close()"},{"line_number":49,"context_line":"        super(WSGIAppTest, self).tearDown()"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    @mock.patch(\u0027nova.db.sqlalchemy.api.configure\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"b56f0f60_96c9cde4","line":48,"in_reply_to":"d5b28201_27f0e842","updated":"2020-12-14 20:37:50.000000000","message":"Ah thank you for catching that.","commit_id":"7aa710dd515cbd5b65fa48672891451a9e595911"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"857b5265480ec1c4355d9fac6faca817beb23f2a","unresolved":true,"context_lines":[{"line_number":68,"context_line":"        mock_get_files.return_value \u003d [self.conf.name]"},{"line_number":69,"context_line":"        mock_setup.side_effect \u003d [test.TestingException, None]"},{"line_number":70,"context_line":"        # We need to mock the global database configure() method, else we will"},{"line_number":71,"context_line":"        # be affected by global database state altered by other tests running"},{"line_number":72,"context_line":"        # in parallel, causing this test to fail with"},{"line_number":73,"context_line":"        # oslo_db.sqlalchemy.enginefacade.AlreadyStartedError. We can instead"},{"line_number":74,"context_line":"        # mock the method to raise an exception if it\u0027s called a second time in"},{"line_number":75,"context_line":"        # this test to simulate the fact that the database does not tolerate"}],"source_content_type":"text/x-python","patch_set":5,"id":"0d4a7efd_e3bb32a7","line":72,"range":{"start_line":71,"start_character":22,"end_line":72,"end_character":21},"updated":"2020-11-23 11:38:57.000000000","message":"See L44","commit_id":"7aa710dd515cbd5b65fa48672891451a9e595911"}],"nova/utils.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"8b4eb50ac494a5b54dc8a3dd6fc3ff8b19759ef5","unresolved":false,"context_lines":[{"line_number":1056,"context_line":""},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"def run_once(message, logger, cleanup\u003dNone):"},{"line_number":1059,"context_line":"    \"\"\""},{"line_number":1060,"context_line":"    Note: this is copied from the placement repo (placement/util.py)"},{"line_number":1061,"context_line":""},{"line_number":1062,"context_line":"    This is a utility function decorator to ensure a function"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_1a2b4795","line":1059,"updated":"2020-10-03 06:29:02.000000000","message":"pep8: H404: multi line docstring should start without a leading new line","commit_id":"fb1ec9279c2ce9e4b99df9b36f5c4b5fb2bd5ee8"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"8b4eb50ac494a5b54dc8a3dd6fc3ff8b19759ef5","unresolved":false,"context_lines":[{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"def run_once(message, logger, cleanup\u003dNone):"},{"line_number":1059,"context_line":"    \"\"\""},{"line_number":1060,"context_line":"    Note: this is copied from the placement repo (placement/util.py)"},{"line_number":1061,"context_line":""},{"line_number":1062,"context_line":"    This is a utility function decorator to ensure a function"},{"line_number":1063,"context_line":"    is run once and only once in an interpreter instance."}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_fa25b3c0","line":1060,"updated":"2020-10-03 06:29:02.000000000","message":"pep8: H404: multi line docstring should start without a leading new line","commit_id":"fb1ec9279c2ce9e4b99df9b36f5c4b5fb2bd5ee8"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"8b4eb50ac494a5b54dc8a3dd6fc3ff8b19759ef5","unresolved":false,"context_lines":[{"line_number":1058,"context_line":"def run_once(message, logger, cleanup\u003dNone):"},{"line_number":1059,"context_line":"    \"\"\""},{"line_number":1060,"context_line":"    Note: this is copied from the placement repo (placement/util.py)"},{"line_number":1061,"context_line":""},{"line_number":1062,"context_line":"    This is a utility function decorator to ensure a function"},{"line_number":1063,"context_line":"    is run once and only once in an interpreter instance."},{"line_number":1064,"context_line":"    The decorated function object can be reset by calling its"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_5a165f5a","line":1061,"updated":"2020-10-03 06:29:02.000000000","message":"pep8: H404: multi line docstring should start without a leading new line","commit_id":"fb1ec9279c2ce9e4b99df9b36f5c4b5fb2bd5ee8"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"8b4eb50ac494a5b54dc8a3dd6fc3ff8b19759ef5","unresolved":false,"context_lines":[{"line_number":1059,"context_line":"    \"\"\""},{"line_number":1060,"context_line":"    Note: this is copied from the placement repo (placement/util.py)"},{"line_number":1061,"context_line":""},{"line_number":1062,"context_line":"    This is a utility function decorator to ensure a function"},{"line_number":1063,"context_line":"    is run once and only once in an interpreter instance."},{"line_number":1064,"context_line":"    The decorated function object can be reset by calling its"},{"line_number":1065,"context_line":"    reset function. All exceptions raised by the wrapped function,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_3a19eb86","line":1062,"updated":"2020-10-03 06:29:02.000000000","message":"pep8: H404: multi line docstring should start without a leading new line","commit_id":"fb1ec9279c2ce9e4b99df9b36f5c4b5fb2bd5ee8"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"8b4eb50ac494a5b54dc8a3dd6fc3ff8b19759ef5","unresolved":false,"context_lines":[{"line_number":1060,"context_line":"    Note: this is copied from the placement repo (placement/util.py)"},{"line_number":1061,"context_line":""},{"line_number":1062,"context_line":"    This is a utility function decorator to ensure a function"},{"line_number":1063,"context_line":"    is run once and only once in an interpreter instance."},{"line_number":1064,"context_line":"    The decorated function object can be reset by calling its"},{"line_number":1065,"context_line":"    reset function. All exceptions raised by the wrapped function,"},{"line_number":1066,"context_line":"    logger and cleanup function will be propagated to the caller."}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_9a10f75b","line":1063,"updated":"2020-10-03 06:29:02.000000000","message":"pep8: H404: multi line docstring should start without a leading new line","commit_id":"fb1ec9279c2ce9e4b99df9b36f5c4b5fb2bd5ee8"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"8b4eb50ac494a5b54dc8a3dd6fc3ff8b19759ef5","unresolved":false,"context_lines":[{"line_number":1061,"context_line":""},{"line_number":1062,"context_line":"    This is a utility function decorator to ensure a function"},{"line_number":1063,"context_line":"    is run once and only once in an interpreter instance."},{"line_number":1064,"context_line":"    The decorated function object can be reset by calling its"},{"line_number":1065,"context_line":"    reset function. All exceptions raised by the wrapped function,"},{"line_number":1066,"context_line":"    logger and cleanup function will be propagated to the caller."},{"line_number":1067,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_7a136366","line":1064,"updated":"2020-10-03 06:29:02.000000000","message":"pep8: H404: multi line docstring should start without a leading new line","commit_id":"fb1ec9279c2ce9e4b99df9b36f5c4b5fb2bd5ee8"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"8b4eb50ac494a5b54dc8a3dd6fc3ff8b19759ef5","unresolved":false,"context_lines":[{"line_number":1062,"context_line":"    This is a utility function decorator to ensure a function"},{"line_number":1063,"context_line":"    is run once and only once in an interpreter instance."},{"line_number":1064,"context_line":"    The decorated function object can be reset by calling its"},{"line_number":1065,"context_line":"    reset function. All exceptions raised by the wrapped function,"},{"line_number":1066,"context_line":"    logger and cleanup function will be propagated to the caller."},{"line_number":1067,"context_line":"    \"\"\""},{"line_number":1068,"context_line":"    def outer_wrapper(func):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_da09cf32","line":1065,"updated":"2020-10-03 06:29:02.000000000","message":"pep8: H404: multi line docstring should start without a leading new line","commit_id":"fb1ec9279c2ce9e4b99df9b36f5c4b5fb2bd5ee8"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"8b4eb50ac494a5b54dc8a3dd6fc3ff8b19759ef5","unresolved":false,"context_lines":[{"line_number":1063,"context_line":"    is run once and only once in an interpreter instance."},{"line_number":1064,"context_line":"    The decorated function object can be reset by calling its"},{"line_number":1065,"context_line":"    reset function. All exceptions raised by the wrapped function,"},{"line_number":1066,"context_line":"    logger and cleanup function will be propagated to the caller."},{"line_number":1067,"context_line":"    \"\"\""},{"line_number":1068,"context_line":"    def outer_wrapper(func):"},{"line_number":1069,"context_line":"        @functools.wraps(func)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_ba04db1a","line":1066,"updated":"2020-10-03 06:29:02.000000000","message":"pep8: H404: multi line docstring should start without a leading new line","commit_id":"fb1ec9279c2ce9e4b99df9b36f5c4b5fb2bd5ee8"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"8b4eb50ac494a5b54dc8a3dd6fc3ff8b19759ef5","unresolved":false,"context_lines":[{"line_number":1064,"context_line":"    The decorated function object can be reset by calling its"},{"line_number":1065,"context_line":"    reset function. All exceptions raised by the wrapped function,"},{"line_number":1066,"context_line":"    logger and cleanup function will be propagated to the caller."},{"line_number":1067,"context_line":"    \"\"\""},{"line_number":1068,"context_line":"    def outer_wrapper(func):"},{"line_number":1069,"context_line":"        @functools.wraps(func)"},{"line_number":1070,"context_line":"        def wrapper(*args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_1a04e717","line":1067,"updated":"2020-10-03 06:29:02.000000000","message":"pep8: H404: multi line docstring should start without a leading new line","commit_id":"fb1ec9279c2ce9e4b99df9b36f5c4b5fb2bd5ee8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"857b5265480ec1c4355d9fac6faca817beb23f2a","unresolved":true,"context_lines":[{"line_number":1059,"context_line":"    \"\"\"This is a utility function decorator to ensure a function"},{"line_number":1060,"context_line":"    is run once and only once in an interpreter instance."},{"line_number":1061,"context_line":""},{"line_number":1062,"context_line":"    Note: this is copied from the placement repo (placement/util.py)"},{"line_number":1063,"context_line":""},{"line_number":1064,"context_line":"    The decorated function object can be reset by calling its"},{"line_number":1065,"context_line":"    reset function. All exceptions raised by the wrapped function,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fc33da67_884f2e7f","line":1062,"updated":"2020-11-23 11:38:57.000000000","message":"As a follow up it would be nice to factor this out to oslo_utils.","commit_id":"7aa710dd515cbd5b65fa48672891451a9e595911"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e40d5ef5e15da0b175c1f65c7dedfe5c7cdecd76","unresolved":true,"context_lines":[{"line_number":1059,"context_line":"    \"\"\"This is a utility function decorator to ensure a function"},{"line_number":1060,"context_line":"    is run once and only once in an interpreter instance."},{"line_number":1061,"context_line":""},{"line_number":1062,"context_line":"    Note: this is copied from the placement repo (placement/util.py)"},{"line_number":1063,"context_line":""},{"line_number":1064,"context_line":"    The decorated function object can be reset by calling its"},{"line_number":1065,"context_line":"    reset function. All exceptions raised by the wrapped function,"}],"source_content_type":"text/x-python","patch_set":5,"id":"ac0347c2_8e3a87a3","line":1062,"in_reply_to":"fc33da67_884f2e7f","updated":"2020-12-14 20:37:50.000000000","message":"Ack, can do.","commit_id":"7aa710dd515cbd5b65fa48672891451a9e595911"}]}
