)]}'
{"nova/compute/resource_tracker.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7f1ed631fc9cc3be1c5e0cec825906b07c27546a","unresolved":false,"context_lines":[{"line_number":683,"context_line":"            self._setup_pci_tracker(context, cn, resources)"},{"line_number":684,"context_line":"            try:"},{"line_number":685,"context_line":"                self._update(context, cn)"},{"line_number":686,"context_line":"            except Exception:"},{"line_number":687,"context_line":"                # If something fails here, remove the node from the"},{"line_number":688,"context_line":"                # compute_nodes dict so the next time we run through we"},{"line_number":689,"context_line":"                # try to heal the problem."}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_cdbf135f","line":686,"updated":"2019-09-25 22:18:48.000000000","message":"Alternatively we could just move the self.compute_nodes[nodename] \u003d cn after the self._update, similar to https://review.opendev.org/#/c/675704/2/nova/compute/resource_tracker.py","commit_id":"50e25c2331c6ff6c8c0cb35e69b326c990c5b8fe"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"1425f10bd4783453e2e08dadd67ed6f24fa05a26","unresolved":false,"context_lines":[{"line_number":661,"context_line":"        :param context: security context"},{"line_number":662,"context_line":"        :param resources: initial values"},{"line_number":663,"context_line":"        :param nodename: node name"},{"line_number":664,"context_line":"        :returns: True if a suitable compute node record was found, else False"},{"line_number":665,"context_line":"        \"\"\""},{"line_number":666,"context_line":"        if not self.driver.rebalances_nodes:"},{"line_number":667,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_0dd0aec8","line":664,"updated":"2019-09-27 07:23:42.000000000","message":"Do we need to briefly describe the exception contained in excutils.save_and_reraise_exception?","commit_id":"0ab73d8ac95950e688f8b195d4106a7e6c9c46c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d668342638163934c1d71c3546638abb497c3b2f","unresolved":false,"context_lines":[{"line_number":661,"context_line":"        :param context: security context"},{"line_number":662,"context_line":"        :param resources: initial values"},{"line_number":663,"context_line":"        :param nodename: node name"},{"line_number":664,"context_line":"        :returns: True if a suitable compute node record was found, else False"},{"line_number":665,"context_line":"        \"\"\""},{"line_number":666,"context_line":"        if not self.driver.rebalances_nodes:"},{"line_number":667,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_d54d18c4","line":664,"in_reply_to":"3fa7e38b_0dd0aec8","updated":"2019-09-30 14:38:30.000000000","message":"I\u0027m not sure what you mean. Do you mean list the various exceptions that could be re-raised when self._update fails? That could be a big list and could grow stale over time so I don\u0027t think that\u0027s very useful here.","commit_id":"0ab73d8ac95950e688f8b195d4106a7e6c9c46c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d668342638163934c1d71c3546638abb497c3b2f","unresolved":false,"context_lines":[{"line_number":688,"context_line":"                # compute_nodes dict so the next time we run through we"},{"line_number":689,"context_line":"                # try to heal the problem."},{"line_number":690,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":691,"context_line":"                    del self.compute_nodes[nodename]"},{"line_number":692,"context_line":"            return True"},{"line_number":693,"context_line":"        elif len(cn_candidates) \u003e 1:"},{"line_number":694,"context_line":"            LOG.error("}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_95c9e026","line":691,"updated":"2019-09-30 14:38:30.000000000","message":"The alternative to this is just simply move the \"self.compute_nodes[nodename] \u003d cn\" line until after self._update returns.","commit_id":"0ab73d8ac95950e688f8b195d4106a7e6c9c46c1"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"e58d69b855bfd58bfbb20d484344a1eea6f29794","unresolved":false,"context_lines":[{"line_number":688,"context_line":"                # compute_nodes dict so the next time we run through we"},{"line_number":689,"context_line":"                # try to heal the problem."},{"line_number":690,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":691,"context_line":"                    del self.compute_nodes[nodename]"},{"line_number":692,"context_line":"            return True"},{"line_number":693,"context_line":"        elif len(cn_candidates) \u003e 1:"},{"line_number":694,"context_line":"            LOG.error("}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_865003d7","line":691,"in_reply_to":"3fa7e38b_95c9e026","updated":"2019-11-21 15:48:15.000000000","message":"I\u0027m struggling to see how this makes the association stale.","commit_id":"0ab73d8ac95950e688f8b195d4106a7e6c9c46c1"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"e58d69b855bfd58bfbb20d484344a1eea6f29794","unresolved":false,"context_lines":[{"line_number":972,"context_line":"        self._populate_assigned_resources(context, instance_by_uuid)"},{"line_number":973,"context_line":""},{"line_number":974,"context_line":"        # update the compute_node"},{"line_number":975,"context_line":"        self._update(context, cn, startup\u003dstartup)"},{"line_number":976,"context_line":"        LOG.debug(\u0027Compute_service record updated for %(host)s:%(node)s\u0027,"},{"line_number":977,"context_line":"                  {\u0027host\u0027: self.host, \u0027node\u0027: nodename})"},{"line_number":978,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_7931e8ec","line":975,"range":{"start_line":975,"start_character":13,"end_line":975,"end_character":20},"updated":"2019-11-21 15:48:15.000000000","message":"In theory the same could happen here, if the other host was being really slow.","commit_id":"0ab73d8ac95950e688f8b195d4106a7e6c9c46c1"}],"nova/tests/functional/regressions/test_bug_1841481.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d06a07086390a50556cffe4a06db6ef7ad2ab6bb","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        # _check_for_nodes_rebalance should have handled the error from"},{"line_number":125,"context_line":"        # _refresh_associations and removed the ComputeNode from the RT cache."},{"line_number":126,"context_line":"        self.assertNotIn(nodename, host2.manager.rt.compute_nodes)"},{"line_number":127,"context_line":"        self.assertTrue(host2.manager.rt.reportclient._provider_tree.exists("},{"line_number":128,"context_line":"            nodename))"},{"line_number":129,"context_line":"        self.assertTrue(host2.manager.rt.reportclient._associations_stale("},{"line_number":130,"context_line":"            cn.uuid))"},{"line_number":131,"context_line":"        # We have to workaround the DBDuplicateEntry that would be handled in"},{"line_number":132,"context_line":"        # the DB API compute_node_create method which normally un-deletes the"},{"line_number":133,"context_line":"        # compute node record with the same UUID value, but for whatever reason"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_ed9bef14","line":130,"range":{"start_line":127,"start_character":8,"end_line":130,"end_character":21},"updated":"2019-09-25 22:15:57.000000000","message":"This is likely where Eric\u0027s portion of the bug fix would come into play:\n\nhttps://review.opendev.org/#/c/678960/\n\nHow could we recreate the issue that the provider tree cache is stale and results in us not re-creating the resource provider even if we do \"re-create\" the compute node? I\u0027m guessing part of that would just be configuring the test to have resource_provider_association_refresh\u003d0.","commit_id":"50e25c2331c6ff6c8c0cb35e69b326c990c5b8fe"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"71bb976f588f81f61294f76e2702b636671fbc5f","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        # in the test from actually destroying the record. We do this so that"},{"line_number":77,"context_line":"        # when update_available_resource on host2 runs the ResourceTracker"},{"line_number":78,"context_line":"        # _check_for_nodes_rebalance method will update the node to host2."},{"line_number":79,"context_line":"        # Again, we\u0027re simulating a race where host2 has gone far enough to"},{"line_number":80,"context_line":"        # run _check_for_nodes_rebalance and update the node to point at host2"},{"line_number":81,"context_line":"        # but before trying to refresh provider associations from placement,"},{"line_number":82,"context_line":"        # and host2 loses the race because host1 deletes the provider between"},{"line_number":83,"context_line":"        # _check_for_nodes_rebalance and _refresh_associations."},{"line_number":84,"context_line":"        with mock.patch(\u0027nova.objects.ComputeNode.destroy\u0027) as cn_destroy:"},{"line_number":85,"context_line":"            host1.manager.update_available_resource(ctxt)"},{"line_number":86,"context_line":"            cn_destroy.assert_called_once_with()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_fc570659","line":83,"range":{"start_line":79,"start_character":8,"end_line":83,"end_character":63},"updated":"2019-11-21 16:26:54.000000000","message":"I think this is probably key to the associations being stale in the provider tree / scheduler report client, because we likely don\u0027t populate the SchedulerReportClient._association_refresh_time dict or pop the entry if the provider doesn\u0027t exist. But it\u0027s been too long since I wrote this to completely remember off the top of my head. The RT calls SchedulerReportClient.get_provider_tree_and_ensure_root and then we go down the rabbit hole from there.","commit_id":"0ab73d8ac95950e688f8b195d4106a7e6c9c46c1"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"e58d69b855bfd58bfbb20d484344a1eea6f29794","unresolved":false,"context_lines":[{"line_number":128,"context_line":"            nodename))"},{"line_number":129,"context_line":"        self.assertTrue(host2.manager.rt.reportclient._associations_stale("},{"line_number":130,"context_line":"            cn.uuid))"},{"line_number":131,"context_line":"        # We have to workaround the DBDuplicateEntry that would be handled in"},{"line_number":132,"context_line":"        # the DB API compute_node_create method which normally un-deletes the"},{"line_number":133,"context_line":"        # compute node record with the same UUID value, but for whatever reason"},{"line_number":134,"context_line":"        # that does not work in this test like in PeriodicNodeRecreateTestCase."},{"line_number":135,"context_line":"        # We get this otherwise: sqlalchemy.exc.InvalidRequestError: This"},{"line_number":136,"context_line":"        # session is in \u0027inactive\u0027 state, due to the SQL transaction being"},{"line_number":137,"context_line":"        # rolled back; no further SQL can be emitted within this transaction."},{"line_number":138,"context_line":"        # zzzeek says it\u0027s due to something with exception handling and I think"},{"line_number":139,"context_line":"        # it might have something to do with threads (the other test uses a"},{"line_number":140,"context_line":"        # single nova-compute service so maybe that\u0027s why it doesn\u0027t hit this)."},{"line_number":141,"context_line":"        # I don\u0027t think this would be an issue outside of our functional test"},{"line_number":142,"context_line":"        # environment so I\u0027m going with the workaround of archiving."},{"line_number":143,"context_line":"        db_api.archive_deleted_rows(context\u003dctxt, max_rows\u003d1000)"},{"line_number":144,"context_line":"        host2.manager.update_available_resource(ctxt)"},{"line_number":145,"context_line":"        # A new ComputeNode record should have been created and the resource"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_797edd1b","line":142,"range":{"start_line":131,"start_character":8,"end_line":142,"end_character":68},"updated":"2019-11-21 15:48:15.000000000","message":"You\u0027ve hit https://bugs.launchpad.net/nova/+bug/1853159, which I\u0027ve proposed a fix for: https://review.opendev.org/695012.","commit_id":"0ab73d8ac95950e688f8b195d4106a7e6c9c46c1"}]}
