)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"894bdb0f28e504093b74c119dd161c1788e4d95c","unresolved":false,"context_lines":[{"line_number":10,"context_line":"Ocata, the ResourceTracker manages multiple compute nodes"},{"line_number":11,"context_line":"via its \"compute_nodes\" variable, but the \"stats\" variable"},{"line_number":12,"context_line":"was still being shared across all nodes, which leads to"},{"line_number":13,"context_line":"leading stats across nodes in an ironic deployment where"},{"line_number":14,"context_line":"a single nova-compute service host is managing multiple"},{"line_number":15,"context_line":"ironic instances (nodes)."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5f7c97a3_a97cea21","line":13,"range":{"start_line":13,"start_character":0,"end_line":13,"end_character":7},"updated":"2018-08-01 10:55:02.000000000","message":"nit: I guess it is leaking","commit_id":"dd1b33860feb98e1a8b924286090b53dd47ff220"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"539a574adaac8ed7e1c37c5c875c69218638b7b4","unresolved":false,"context_lines":[{"line_number":10,"context_line":"Ocata, the ResourceTracker manages multiple compute nodes"},{"line_number":11,"context_line":"via its \"compute_nodes\" variable, but the \"stats\" variable"},{"line_number":12,"context_line":"was still being shared across all nodes, which leads to"},{"line_number":13,"context_line":"leading stats across nodes in an ironic deployment where"},{"line_number":14,"context_line":"a single nova-compute service host is managing multiple"},{"line_number":15,"context_line":"ironic instances (nodes)."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5f7c97a3_a5b3aa98","line":13,"range":{"start_line":13,"start_character":0,"end_line":13,"end_character":7},"in_reply_to":"5f7c97a3_a97cea21","updated":"2018-08-01 13:52:19.000000000","message":"oops yeah","commit_id":"dd1b33860feb98e1a8b924286090b53dd47ff220"}],"nova/compute/resource_tracker.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"894bdb0f28e504093b74c119dd161c1788e4d95c","unresolved":false,"context_lines":[{"line_number":606,"context_line":"    def _copy_resources(self, compute_node, resources):"},{"line_number":607,"context_line":"        \"\"\"Copy resource values to supplied compute_node.\"\"\""},{"line_number":608,"context_line":"        nodename \u003d resources[\u0027hypervisor_hostname\u0027]"},{"line_number":609,"context_line":"        if nodename in self.stats:"},{"line_number":610,"context_line":"            stats \u003d self.stats[nodename]"},{"line_number":611,"context_line":"        else:"},{"line_number":612,"context_line":"            stats \u003d compute_stats.Stats()"},{"line_number":613,"context_line":"            self.stats[nodename] \u003d stats"},{"line_number":614,"context_line":"        # purge old stats and init with anything passed in by the driver"},{"line_number":615,"context_line":"        # NOTE(danms): Preserve \u0027failed_builds\u0027 across the stats clearing,"},{"line_number":616,"context_line":"        # as that is not part of resources"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_d105507a","line":613,"range":{"start_line":609,"start_character":8,"end_line":613,"end_character":40},"updated":"2018-08-01 10:55:02.000000000","message":"We don\u0027t need this, the collections.defaultdict(compute_stats.Stats) already handles the missing key.\n\nAs \u0027stats\u0027 is used below you can simplify this to\n\nstats \u003d self.stats[nodename]","commit_id":"dd1b33860feb98e1a8b924286090b53dd47ff220"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"539a574adaac8ed7e1c37c5c875c69218638b7b4","unresolved":false,"context_lines":[{"line_number":606,"context_line":"    def _copy_resources(self, compute_node, resources):"},{"line_number":607,"context_line":"        \"\"\"Copy resource values to supplied compute_node.\"\"\""},{"line_number":608,"context_line":"        nodename \u003d resources[\u0027hypervisor_hostname\u0027]"},{"line_number":609,"context_line":"        if nodename in self.stats:"},{"line_number":610,"context_line":"            stats \u003d self.stats[nodename]"},{"line_number":611,"context_line":"        else:"},{"line_number":612,"context_line":"            stats \u003d compute_stats.Stats()"},{"line_number":613,"context_line":"            self.stats[nodename] \u003d stats"},{"line_number":614,"context_line":"        # purge old stats and init with anything passed in by the driver"},{"line_number":615,"context_line":"        # NOTE(danms): Preserve \u0027failed_builds\u0027 across the stats clearing,"},{"line_number":616,"context_line":"        # as that is not part of resources"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_656ef2fe","line":613,"range":{"start_line":609,"start_character":8,"end_line":613,"end_character":40},"in_reply_to":"5f7c97a3_d105507a","updated":"2018-08-01 13:52:19.000000000","message":"Sure but that doesn\u0027t set the key / value does it? The point here was to initialize the key/value in the dict rather than just get a default.\n\nI guess it does insert it:\n\nhttps://docs.python.org/2/library/collections.html#collections.defaultdict\n\n\u003e If default_factory is not None, it is called without arguments to provide a default value for the given key, this value is inserted in the dictionary for the key, and returned.\n\nWill change.","commit_id":"dd1b33860feb98e1a8b924286090b53dd47ff220"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cb62fc6788384e9bdd365601a883c1944d382956","unresolved":false,"context_lines":[{"line_number":606,"context_line":"    def _copy_resources(self, compute_node, resources):"},{"line_number":607,"context_line":"        \"\"\"Copy resource values to supplied compute_node.\"\"\""},{"line_number":608,"context_line":"        nodename \u003d resources[\u0027hypervisor_hostname\u0027]"},{"line_number":609,"context_line":"        if nodename in self.stats:"},{"line_number":610,"context_line":"            stats \u003d self.stats[nodename]"},{"line_number":611,"context_line":"        else:"},{"line_number":612,"context_line":"            stats \u003d compute_stats.Stats()"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_651cb27a","line":609,"updated":"2018-08-01 13:54:47.000000000","message":"Is this needed with the defaultdict?","commit_id":"a10980a6f4ba04436e2b42ca9d8a456e3fb116fe"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d2323b27c0be61fe8b27b56fc7c00e95cd6b8ffb","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        # Dict of objects.ComputeNode objects, keyed by nodename"},{"line_number":139,"context_line":"        self.compute_nodes \u003d {}"},{"line_number":140,"context_line":"        # Dict of Stats objects, keyed by nodename"},{"line_number":141,"context_line":"        self.stats \u003d collections.defaultdict(compute_stats.Stats)"},{"line_number":142,"context_line":"        self.tracked_instances \u003d {}"},{"line_number":143,"context_line":"        self.tracked_migrations \u003d {}"},{"line_number":144,"context_line":"        monitor_handler \u003d monitors.MonitorHandler(self)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_609a6060","line":141,"updated":"2018-08-01 14:14:15.000000000","message":"So, I was thinking we probably need to clean up stale entries here when we have a node leave this host. This could be due to a rebalance or decommissioning a node altogether. With a rebalance, this could grow to eventually hold stale data from all the nodes in the system in memory over time. But, I see that we don\u0027t clean up self.compute_nodes either, although it would be a smaller footprint.\n\nAnyway, for follow-up, we should probably have a method that the compute manager can call to let the RT know it can disavow information about a particular node, including the stats.","commit_id":"f0dfc6555a02d5328102006f9e7fc4916db79835"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3fd89edca6891c259c015444b3173a0a1af25fb6","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        # Dict of objects.ComputeNode objects, keyed by nodename"},{"line_number":139,"context_line":"        self.compute_nodes \u003d {}"},{"line_number":140,"context_line":"        # Dict of Stats objects, keyed by nodename"},{"line_number":141,"context_line":"        self.stats \u003d collections.defaultdict(compute_stats.Stats)"},{"line_number":142,"context_line":"        self.tracked_instances \u003d {}"},{"line_number":143,"context_line":"        self.tracked_migrations \u003d {}"},{"line_number":144,"context_line":"        monitor_handler \u003d monitors.MonitorHandler(self)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_e0ef5083","line":141,"in_reply_to":"5f7c97a3_609a6060","updated":"2018-08-01 14:24:00.000000000","message":"Yeah I suppose in this block:\n\nhttps://github.com/openstack/nova/blob/47ef500f4492c731ebfa33a12822ef6b5db4e7e2/nova/compute/manager.py#L7759","commit_id":"f0dfc6555a02d5328102006f9e7fc4916db79835"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ebc41308812305955f7bd5dac7f616f39a372c51","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        # Dict of objects.ComputeNode objects, keyed by nodename"},{"line_number":139,"context_line":"        self.compute_nodes \u003d {}"},{"line_number":140,"context_line":"        # Dict of Stats objects, keyed by nodename"},{"line_number":141,"context_line":"        self.stats \u003d collections.defaultdict(compute_stats.Stats)"},{"line_number":142,"context_line":"        self.tracked_instances \u003d {}"},{"line_number":143,"context_line":"        self.tracked_migrations \u003d {}"},{"line_number":144,"context_line":"        monitor_handler \u003d monitors.MonitorHandler(self)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_a09ab80e","line":141,"in_reply_to":"5f7c97a3_e0ef5083","updated":"2018-08-01 14:25:15.000000000","message":"self.old_resources probably falls into that bucket too.","commit_id":"f0dfc6555a02d5328102006f9e7fc4916db79835"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"eb89c452cad85522d555157b97088fe75ddca16c","unresolved":false,"context_lines":[{"line_number":1154,"context_line":"        if is_removed_instance and uuid in self.is_bfv:"},{"line_number":1155,"context_line":"            del self.is_bfv[uuid]"},{"line_number":1156,"context_line":""},{"line_number":1157,"context_line":"        cn.current_workload \u003d self.stats.calculate_workload()"},{"line_number":1158,"context_line":"        if self.pci_tracker:"},{"line_number":1159,"context_line":"            obj \u003d self.pci_tracker.stats.to_device_pools_obj()"},{"line_number":1160,"context_line":"            cn.pci_device_pools \u003d obj"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_eee89ae0","line":1157,"range":{"start_line":1157,"start_character":30,"end_line":1157,"end_character":40},"updated":"2018-08-01 18:44:52.000000000","message":"This is wrong.","commit_id":"992f049825905ace410bd0ac0d6e7a2cc0726119"}],"nova/tests/unit/compute/test_resource_tracker.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"894bdb0f28e504093b74c119dd161c1788e4d95c","unresolved":false,"context_lines":[{"line_number":1584,"context_line":"        self._setup_rt()"},{"line_number":1585,"context_line":"        cn \u003d _COMPUTE_NODE_FIXTURES[0].obj_clone()"},{"line_number":1586,"context_line":"        self.rt.compute_nodes[_NODENAME] \u003d cn"},{"line_number":1587,"context_line":"        self.rt.stats[_NODENAME] \u003d compute_stats.Stats()"},{"line_number":1588,"context_line":""},{"line_number":1589,"context_line":"        # not using mock.sentinel.ctx because instance_claim calls #elevated"},{"line_number":1590,"context_line":"        self.ctx \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_31528469","line":1587,"range":{"start_line":1587,"start_character":8,"end_line":1587,"end_character":56},"updated":"2018-08-01 10:55:02.000000000","message":"I guess this also handled by the defaultdict(Stats) in the resource_traceker __init__","commit_id":"dd1b33860feb98e1a8b924286090b53dd47ff220"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"539a574adaac8ed7e1c37c5c875c69218638b7b4","unresolved":false,"context_lines":[{"line_number":1584,"context_line":"        self._setup_rt()"},{"line_number":1585,"context_line":"        cn \u003d _COMPUTE_NODE_FIXTURES[0].obj_clone()"},{"line_number":1586,"context_line":"        self.rt.compute_nodes[_NODENAME] \u003d cn"},{"line_number":1587,"context_line":"        self.rt.stats[_NODENAME] \u003d compute_stats.Stats()"},{"line_number":1588,"context_line":""},{"line_number":1589,"context_line":"        # not using mock.sentinel.ctx because instance_claim calls #elevated"},{"line_number":1590,"context_line":"        self.ctx \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_05529e36","line":1587,"range":{"start_line":1587,"start_character":8,"end_line":1587,"end_character":56},"in_reply_to":"5f7c97a3_31528469","updated":"2018-08-01 13:52:19.000000000","message":"I think I had added this before changing to use defaultdict. Will remove.","commit_id":"dd1b33860feb98e1a8b924286090b53dd47ff220"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"894bdb0f28e504093b74c119dd161c1788e4d95c","unresolved":false,"context_lines":[{"line_number":2677,"context_line":"        self._setup_rt()"},{"line_number":2678,"context_line":"        cn \u003d _COMPUTE_NODE_FIXTURES[0].obj_clone()"},{"line_number":2679,"context_line":"        self.rt.compute_nodes[_NODENAME] \u003d cn"},{"line_number":2680,"context_line":"        self.rt.stats[_NODENAME] \u003d compute_stats.Stats()"},{"line_number":2681,"context_line":"        self.instance \u003d _INSTANCE_FIXTURES[0].obj_clone()"},{"line_number":2682,"context_line":""},{"line_number":2683,"context_line":"    @mock.patch(\u0027nova.compute.utils.is_volume_backed_instance\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_1143c898","line":2680,"updated":"2018-08-01 10:55:02.000000000","message":"ditto","commit_id":"dd1b33860feb98e1a8b924286090b53dd47ff220"}]}
