)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"1f06bf4f5be9b39b57711dac864582b5821c8b25","unresolved":false,"context_lines":[{"line_number":12,"context_line":"updating resources for other nodes."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Also: Re-order querying available nodes from the driver and selecting"},{"line_number":15,"context_line":"all compute nodes from the DB to avoid potential race conditions."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I963a22001b00e0aa873e66033098bb2d1a17f111"},{"line_number":18,"context_line":"Closes-bug: 1352510"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"9a80dd14_a8954088","line":15,"updated":"2015-03-06 19:03:25.000000000","message":"This sounds like two separate patches to me.","commit_id":"9ddcc402159ccc7e1866e027d9f9e22aa76df3b2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f89f98795993b5afe0e0bdceecc08e0ec0c42adf","unresolved":false,"context_lines":[{"line_number":12,"context_line":"updating resources for other nodes."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Also: Re-order querying available nodes from the driver and selecting"},{"line_number":15,"context_line":"all compute nodes from the DB to avoid potential race conditions."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I963a22001b00e0aa873e66033098bb2d1a17f111"},{"line_number":18,"context_line":"Closes-bug: 1352510"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"9a80dd14_8b6a36b1","line":15,"in_reply_to":"9a80dd14_a8954088","updated":"2015-03-06 19:24:01.000000000","message":"If you buy the premise of the argument, I think it makes sense to make both of these changes together, since they\u0027re so tightly related.","commit_id":"9ddcc402159ccc7e1866e027d9f9e22aa76df3b2"}],"nova/compute/manager.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"98035ba7562a6c6efba275b973382c9679a60cab","unresolved":false,"context_lines":[{"line_number":5653,"context_line":"                LOG.audit(_(\"Deleting orphan compute node %s\") % cn.id)"},{"line_number":5654,"context_line":"                cn.destroy()"},{"line_number":5655,"context_line":""},{"line_number":5656,"context_line":"        self._resource_tracker_dict \u003d new_resource_tracker_dict"},{"line_number":5657,"context_line":""},{"line_number":5658,"context_line":"    def _get_compute_nodes_in_db(self, context):"},{"line_number":5659,"context_line":"        service \u003d objects.Service.get_by_compute_host(context, self.host)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_926cded0","side":"PARENT","line":5656,"updated":"2014-08-05 00:43:39.000000000","message":"This is fine, but technically wasn\u0027t necessary to move this line :)","commit_id":"4fcfd609bc4b4701c3c12c0a011ebbf8fd6444d0"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"77b2fb749976177d7db359c55872679ae17b4d24","unresolved":false,"context_lines":[{"line_number":5667,"context_line":"                # tracker tried to update a deleted record and failed."},{"line_number":5668,"context_line":"                # Don\u0027t add this resource tracker to the new dict, so"},{"line_number":5669,"context_line":"                # that this will resolve itself on the next run."},{"line_number":5670,"context_line":"                continue"},{"line_number":5671,"context_line":"            except Exception as e:"},{"line_number":5672,"context_line":"                LOG.exception(_(\"Error updating resources for node \""},{"line_number":5673,"context_line":"                                \"%(node)%s: %(e)s\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_2d0d6593","line":5670,"updated":"2014-08-05 12:52:41.000000000","message":"Don\u0027t want to add a low level log information here?","commit_id":"87153af3a0da9368f0ea5cdcb621bc8a17809108"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"4809089eef5130a0a5641bcf40af94eef372c4b8","unresolved":false,"context_lines":[{"line_number":5667,"context_line":"                # tracker tried to update a deleted record and failed."},{"line_number":5668,"context_line":"                # Don\u0027t add this resource tracker to the new dict, so"},{"line_number":5669,"context_line":"                # that this will resolve itself on the next run."},{"line_number":5670,"context_line":"                continue"},{"line_number":5671,"context_line":"            except Exception as e:"},{"line_number":5672,"context_line":"                LOG.exception(_(\"Error updating resources for node \""},{"line_number":5673,"context_line":"                                \"%(node)%s: %(e)s\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_6de4b342","line":5670,"in_reply_to":"baada198_2d0d6593","updated":"2014-08-05 16:29:48.000000000","message":"I\u0027m not sure it\u0027s worthwhile, because it\u0027s a case we can expect to hit when someone removes the record from the DB.","commit_id":"87153af3a0da9368f0ea5cdcb621bc8a17809108"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"77b2fb749976177d7db359c55872679ae17b4d24","unresolved":false,"context_lines":[{"line_number":5671,"context_line":"            except Exception as e:"},{"line_number":5672,"context_line":"                LOG.exception(_(\"Error updating resources for node \""},{"line_number":5673,"context_line":"                                \"%(node)%s: %(e)s\"),"},{"line_number":5674,"context_line":"                              {\u0027node\u0027: nodename, \u0027e\u0027: e})"},{"line_number":5675,"context_line":"            new_resource_tracker_dict[nodename] \u003d rt"},{"line_number":5676,"context_line":""},{"line_number":5677,"context_line":"        self._resource_tracker_dict \u003d new_resource_tracker_dict"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_2de9e582","line":5674,"updated":"2014-08-05 12:52:41.000000000","message":"Because you are using LOG.exception() I don\u0027t think you have to pass the exception object \u0027e\u0027 in the message. It will added in the log message in all cases, no?","commit_id":"87153af3a0da9368f0ea5cdcb621bc8a17809108"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"4809089eef5130a0a5641bcf40af94eef372c4b8","unresolved":false,"context_lines":[{"line_number":5671,"context_line":"            except Exception as e:"},{"line_number":5672,"context_line":"                LOG.exception(_(\"Error updating resources for node \""},{"line_number":5673,"context_line":"                                \"%(node)%s: %(e)s\"),"},{"line_number":5674,"context_line":"                              {\u0027node\u0027: nodename, \u0027e\u0027: e})"},{"line_number":5675,"context_line":"            new_resource_tracker_dict[nodename] \u003d rt"},{"line_number":5676,"context_line":""},{"line_number":5677,"context_line":"        self._resource_tracker_dict \u003d new_resource_tracker_dict"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_cdca1fa0","line":5674,"in_reply_to":"baada198_2de9e582","updated":"2014-08-05 16:29:48.000000000","message":"Possibly, but I don\u0027t think it actually does, at least not on the same line as the error message I want to log above. You\u0027d likely see it at the end of the traceback, but it\u0027s nice having it with the error string above.","commit_id":"87153af3a0da9368f0ea5cdcb621bc8a17809108"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"ec2e1ea75a7d73d8befe57ab59b92e7923c157c4","unresolved":false,"context_lines":[{"line_number":5674,"context_line":"                # that this will resolve itself on the next run."},{"line_number":5675,"context_line":"                continue"},{"line_number":5676,"context_line":"            except Exception as e:"},{"line_number":5677,"context_line":"                LOG.exception(_(\"Error updating resources for node \""},{"line_number":5678,"context_line":"                                \"%(node)%s: %(e)s\"),"},{"line_number":5679,"context_line":"                              {\u0027node\u0027: nodename, \u0027e\u0027: e})"},{"line_number":5680,"context_line":"            new_resource_tracker_dict[nodename] \u003d rt"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_5b25a5ab","line":5677,"updated":"2014-08-07 05:39:01.000000000","message":"i18n should be used here for newly added logs","commit_id":"f1ee32d8ceb9e812d7fdbf31fb15387edba46bab"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"53cd87784d3e7b482871476c9f237690bd887644","unresolved":false,"context_lines":[{"line_number":5672,"context_line":"                # tracker tried to update a deleted record and failed."},{"line_number":5673,"context_line":"                # Don\u0027t add this resource tracker to the new dict, so"},{"line_number":5674,"context_line":"                # that this will resolve itself on the next run."},{"line_number":5675,"context_line":"                continue"},{"line_number":5676,"context_line":"            except Exception as e:"},{"line_number":5677,"context_line":"                LOG.exception(_LE(\"Error updating resources for node \""},{"line_number":5678,"context_line":"                                  \"%(node)%s: %(e)s\"),"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa98f980_235a2083","line":5675,"updated":"2014-09-04 13:38:54.000000000","message":"Kind of feels that a debug log would be useful here ?   Exception handlers that don\u0027t even log make me jumpy","commit_id":"972f4f27a6ed3c59e906b7118a9cab7edffe1643"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"53cd87784d3e7b482871476c9f237690bd887644","unresolved":false,"context_lines":[{"line_number":5686,"context_line":"        self._resource_tracker_dict \u003d new_resource_tracker_dict"},{"line_number":5687,"context_line":""},{"line_number":5688,"context_line":"        # Delete orphan compute node not reported by driver but still in db"},{"line_number":5689,"context_line":"        for cn in compute_nodes_in_db:"},{"line_number":5690,"context_line":"            if cn.hypervisor_hostname not in nodenames:"},{"line_number":5691,"context_line":"                LOG.audit(_(\"Deleting orphan compute node %s\") % cn.id)"},{"line_number":5692,"context_line":"                cn.destroy()"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa98f980_039c3c0e","line":5689,"updated":"2014-09-04 13:38:54.000000000","message":"Isn\u0027t there a risk here that you going to delete a node that\u0027s just been added by another process but which wasn\u0027t listed (yet) in ones returned by the driver ?","commit_id":"972f4f27a6ed3c59e906b7118a9cab7edffe1643"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"2b9037a56a5d93b88b3dda22e496a245a4ccd83e","unresolved":false,"context_lines":[{"line_number":5686,"context_line":"        self._resource_tracker_dict \u003d new_resource_tracker_dict"},{"line_number":5687,"context_line":""},{"line_number":5688,"context_line":"        # Delete orphan compute node not reported by driver but still in db"},{"line_number":5689,"context_line":"        for cn in compute_nodes_in_db:"},{"line_number":5690,"context_line":"            if cn.hypervisor_hostname not in nodenames:"},{"line_number":5691,"context_line":"                LOG.audit(_(\"Deleting orphan compute node %s\") % cn.id)"},{"line_number":5692,"context_line":"                cn.destroy()"}],"source_content_type":"text/x-python","patch_set":5,"id":"baa201ad_52ee9e89","line":5689,"in_reply_to":"fa98f980_039c3c0e","updated":"2014-09-30 18:12:27.000000000","message":"No, because it wouldn\u0027t be in \u0027compute_nodes_in_db\u0027. That\u0027s pretty much what I\u0027m fixing here.\n\nSay a new node is in the process of being added. The code here will:\n\n1) Query the list of nodes in the DB.\n2) Get list of nodes from the driver.\n    a) If the new node existed in #1, it means that the driver will also return it in \u0027get_available_nodes()\u0027. And this code will not remove it.\n    b) if the new node does not exist in #1 and does exist here in #2, the node\nwill not be in \u0027compute_nodes_in_db\u0027, so we\u0027d never check it here in this loop.\n    c) If the new node does not exist in #1 and does not exist in #2, then we\u0027re\nalso obviously fine here.\n\nThe old code has #1 and #2 reversed.. in which case you DO run into the problem.  A node could be in \u0027compute_nodes_in_db\u0027 that is not in the list of\nnodes in the driver in that case... and this loop would remove it.","commit_id":"972f4f27a6ed3c59e906b7118a9cab7edffe1643"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f89f98795993b5afe0e0bdceecc08e0ec0c42adf","unresolved":false,"context_lines":[{"line_number":6062,"context_line":"        new_resource_tracker_dict \u003d {}"},{"line_number":6063,"context_line":""},{"line_number":6064,"context_line":"        # NOTE(comstud): To avoid races with another process that may"},{"line_number":6065,"context_line":"        # retrieve available nodes and add/delete them to/from nova,"},{"line_number":6066,"context_line":"        # we need to make sure to query the DB instances first, and then"},{"line_number":6067,"context_line":"        # query the driver\u0027s available nodes. This avoids a race where"},{"line_number":6068,"context_line":"        # one process may add a node that shows up in get_available_nodes()"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a80dd14_4b083e28","line":6065,"updated":"2015-03-06 19:24:01.000000000","message":"Since there is only ever one nova-compute process (RIGHT?) I don\u0027t think this can ever happen in a normal deployment. Can you point me to a situation where this is actually a problem?\n\nI feel like if we have this race with \"multiple processes\" we probably have a bunch more, and we need to audit the rest of the code to find them, if that\u0027s a thing we need/want to support.","commit_id":"9ddcc402159ccc7e1866e027d9f9e22aa76df3b2"}],"nova/tests/compute/test_compute_mgr.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"3b57064c932d0cb4bd3fdb704abbc2f6eb7db9cf","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                if db_node.hypervisor_hostname \u003d\u003d \u0027node1\u0027:"},{"line_number":114,"context_line":"                    db_node.destroy.assert_called_once_with()"},{"line_number":115,"context_line":"                else:"},{"line_number":116,"context_line":"                    self.assertFalse(db_node.called)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        _test_inner()"},{"line_number":119,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_88fcae72","line":116,"updated":"2014-08-05 05:15:40.000000000","message":"eh, I muffed this. This should be db_node.destroy.called","commit_id":"b57ab84158a04cb8ee7c271dd307be5ce2171b11"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"98035ba7562a6c6efba275b973382c9679a60cab","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                else:"},{"line_number":116,"context_line":"                    self.assertFalse(db_node.called)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"        _test_inner()"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def test_allocate_network_succeeds_after_retries(self):"},{"line_number":121,"context_line":"        self.flags(network_allocate_retries\u003d8)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_329a32c5","line":118,"updated":"2014-08-05 00:43:39.000000000","message":"excellent test case, Chris. nice work.","commit_id":"b57ab84158a04cb8ee7c271dd307be5ce2171b11"},{"author":{"_account_id":8412,"name":"Mike Durnosvistov","email":"glacierr.dev@gmail.com","username":"mdurnosvistov"},"change_message_id":"16d962bdf889aa971790f03241c38b8550d36c6b","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        @mock.patch.object(self.compute, \u0027_get_resource_tracker\u0027)"},{"line_number":100,"context_line":"        @mock.patch.object(self.compute.driver, \u0027get_available_nodes\u0027)"},{"line_number":101,"context_line":"        @mock.patch.object(self.compute, \u0027_get_compute_nodes_in_db\u0027)"},{"line_number":102,"context_line":"        def _test_inner(get_db_nodes, get_avail_nodes, get_rt):"},{"line_number":103,"context_line":"            get_db_nodes.return_value \u003d db_nodes"},{"line_number":104,"context_line":"            get_avail_nodes.return_value \u003d avail_nodes"},{"line_number":105,"context_line":"            get_rt.side_effect \u003d _get_rt_side_effect"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aa7fdbe_d15ab74f","line":102,"updated":"2014-10-19 22:30:24.000000000","message":"You didn\u0027t need use additional function -\u003e\n\n    from nova.compute import manager\n    from nova.virt import fake as fake_driver\n\n    @mock.patch.object(manager.ComputeManager, \u0027_get_resource_tracker\u0027)\n    @mock.patch.object(fake_driver.ComputeDriver, \u0027get_available_nodes\u0027)\n    @mock.patch.object(manager.ComputeManager, \u0027_get_compute_nodes_in_db\u0027)\n    def test_update_available_resource(self, get_db_nodes, get_avail_nodes,\n                                       get_rt):\n        ...","commit_id":"5f9a39c7697eefb1189e5f7b06975ac26c54a105"},{"author":{"_account_id":8412,"name":"Mike Durnosvistov","email":"glacierr.dev@gmail.com","username":"mdurnosvistov"},"change_message_id":"16d962bdf889aa971790f03241c38b8550d36c6b","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            get_avail_nodes.return_value \u003d avail_nodes"},{"line_number":105,"context_line":"            get_rt.side_effect \u003d _get_rt_side_effect"},{"line_number":106,"context_line":"            self.compute.update_available_resource(ctxt)"},{"line_number":107,"context_line":"            get_db_nodes.assert_called_once_with(ctxt)"},{"line_number":108,"context_line":"            self.assertEqual([mock.call(node) for node in avail_nodes],"},{"line_number":109,"context_line":"                             get_rt.call_args_list)"},{"line_number":110,"context_line":"            for rt in rts:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aa7fdbe_91402f58","line":107,"updated":"2014-10-19 22:30:24.000000000","message":"get_db_nodes.assert_called_once_with(ctxt, use_slave\u003dTrue)","commit_id":"5f9a39c7697eefb1189e5f7b06975ac26c54a105"}]}
