)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"0288848535fc80b2f3f8a83c132f05fc326bfe57","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"In CommonAgentLoop class, there is logic to detect tap device is changed"},{"line_number":10,"context_line":"locally or not by comparing timestamp with previous."},{"line_number":11,"context_line":"Sometimes timestamp value could be None depending on the timing (see bug/1781129)"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"But current _get_devices_locally_modified logic can not detect local"},{"line_number":14,"context_line":"change from None to something because _get_devices_locally_modified"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5f7c97a3_3c8f5030","line":11,"updated":"2018-07-25 08:33:53.000000000","message":"nit: this line is a bit too long","commit_id":"b803195a9979f7b3b0fd9cea41699b33fc8cf2bb"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"0288848535fc80b2f3f8a83c132f05fc326bfe57","unresolved":false,"context_lines":[{"line_number":14,"context_line":"change from None to something because _get_devices_locally_modified"},{"line_number":15,"context_line":"function don\u0027t always compare if previous timestamp value was None."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"In order not to miss updated device always, better not to use dict.get() to"},{"line_number":18,"context_line":"know previous iteration have timestamp or not."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: Ib0361ad5c281f88558e8e048cfec588b9f9b1de4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5f7c97a3_fc98f876","line":17,"updated":"2018-07-25 08:33:53.000000000","message":"nit: and this also","commit_id":"b803195a9979f7b3b0fd9cea41699b33fc8cf2bb"}],"neutron/plugins/ml2/drivers/agent/_common_agent.py":[{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"b3a47caff17df0f93700489c774d799d658fcf9c","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        it will not be returned because this means it is new."},{"line_number":367,"context_line":"        \"\"\""},{"line_number":368,"context_line":"        return {device for device, timestamp in timestamps.items()"},{"line_number":369,"context_line":"                if device in previous_timestamps.keys() and"},{"line_number":370,"context_line":"                timestamp !\u003d previous_timestamps.get(device)}"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    def scan_devices(self, previous, sync):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_1b516831","line":369,"range":{"start_line":369,"start_character":19,"end_line":369,"end_character":55},"updated":"2018-07-11 21:14:06.000000000","message":"Change it to \u0027device in previous_timestamps\u0027 should work the same.","commit_id":"d8cfea4ba58402f3814ad05c7ced5f7944afae11"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"b3a47caff17df0f93700489c774d799d658fcf9c","unresolved":false,"context_lines":[{"line_number":393,"context_line":"        # doesn\u0027t exist for a device, this calculation is skipped for that"},{"line_number":394,"context_line":"        # device."},{"line_number":395,"context_line":"        device_info[\u0027timestamps\u0027] \u003d self.mgr.get_devices_modified_timestamps("},{"line_number":396,"context_line":"            current_devices)"},{"line_number":397,"context_line":"        locally_updated \u003d self._get_devices_locally_modified("},{"line_number":398,"context_line":"            device_info[\u0027timestamps\u0027], previous[\u0027timestamps\u0027])"},{"line_number":399,"context_line":"        if locally_updated:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_563337f8","line":396,"updated":"2018-07-11 21:14:06.000000000","message":"An alternative approach is to add a check for each device and remove the device whose timestamp is None. Possibly, the set \u0027current\u0027 should be updated to remove those devices with None timestamp?\n\nJust an alternative to consider.","commit_id":"d8cfea4ba58402f3814ad05c7ced5f7944afae11"},{"author":{"_account_id":14764,"name":"Yuki Nishiwaki","email":"uckey.1067@gmail.com","username":"ukinau"},"change_message_id":"299268158f86eb4024501f1e0e859ba55e1db439","unresolved":false,"context_lines":[{"line_number":393,"context_line":"        # doesn\u0027t exist for a device, this calculation is skipped for that"},{"line_number":394,"context_line":"        # device."},{"line_number":395,"context_line":"        device_info[\u0027timestamps\u0027] \u003d self.mgr.get_devices_modified_timestamps("},{"line_number":396,"context_line":"            current_devices)"},{"line_number":397,"context_line":"        locally_updated \u003d self._get_devices_locally_modified("},{"line_number":398,"context_line":"            device_info[\u0027timestamps\u0027], previous[\u0027timestamps\u0027])"},{"line_number":399,"context_line":"        if locally_updated:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_7ffe433a","line":396,"in_reply_to":"5f7c97a3_563337f8","updated":"2018-07-12 03:06:52.000000000","message":"that\u0027s right. we have to update current devices if we failed to get timestamp.\nand probably that solution is much suitable rather than changing the logic around timestamp check.","commit_id":"d8cfea4ba58402f3814ad05c7ced5f7944afae11"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"09fbb79db453c4c3d76a37ab799c1e7d8f6e03ae","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        returned because this means it is new."},{"line_number":367,"context_line":"        \"\"\""},{"line_number":368,"context_line":"        return {device for device, timestamp in timestamps.items()"},{"line_number":369,"context_line":"                if previous_timestamps.get(device) and"},{"line_number":370,"context_line":"                timestamp !\u003d previous_timestamps.get(device)}"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_f9de8f0e","line":369,"range":{"start_line":369,"start_character":19,"end_line":369,"end_character":50},"updated":"2018-07-17 03:16:44.000000000","message":"The problem seems to be, in the case for LinuxBridge there is an edge case where it can return a None, making this check fail. Couldn\u0027t we simply instead change this to:\n\n  device in previous_timestamps\n\nIe:\n\n  return {device for device, timestamp in timestamps.items()\n          if device in previous_timestamps and\n          timestamp !\u003d previous_timestamps.get(device)\n\nOr rather, the existence of device in previous_timestamps has been confirmed in the first check, so:\n\n  return {device for device, timestamp in timestamps.items()\n          if device in previous_timestamps and\n          timestamp !\u003d previous_timestamps[device]\n\nThis would mean it can now handle the odd None and should still see a change if there is. Ie. no extra loop required.\n\nI guess this wont remove None values from the agent managers timestamps. According to the bug, it\u0027s rare, so is it something that every check will now have to loop for or a rare edge case or is it better to be able to deal with None values? If not maybe it needs to be apart of the contract we expect plugins to handle. Maybe mention in the abstact class doc string that devices with None timestamps should be stripped.","commit_id":"92efc37d080597cee175cd085534b012679dd63d"},{"author":{"_account_id":14764,"name":"Yuki Nishiwaki","email":"uckey.1067@gmail.com","username":"ukinau"},"change_message_id":"d3557d2d80fe26f38e959b608ac03f6c068b54be","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        returned because this means it is new."},{"line_number":367,"context_line":"        \"\"\""},{"line_number":368,"context_line":"        return {device for device, timestamp in timestamps.items()"},{"line_number":369,"context_line":"                if previous_timestamps.get(device) and"},{"line_number":370,"context_line":"                timestamp !\u003d previous_timestamps.get(device)}"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_9aebc90f","line":369,"range":{"start_line":369,"start_character":19,"end_line":369,"end_character":50},"in_reply_to":"5f7c97a3_f9de8f0e","updated":"2018-07-17 06:05:28.000000000","message":"I understood your point. If we require really performance here that do not want to allow 1 extra loop, probably we need other solution and I like your point you wrote in last sentence.\nAccording to that, probably I need to do 2 extra things\n\n * Write abstract class doc string that devices with None timestamps should be stripped\n * Change linuxbridage-agent logic to follow this. \n\nBut let me open to other opinion about this before work on it. If original solution can be acceptable, i\u0027m happy to proceed with origin solution.","commit_id":"92efc37d080597cee175cd085534b012679dd63d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2e9db41da18c574b427c0e27963cbe166adfc934","unresolved":false,"context_lines":[{"line_number":373,"context_line":"    def _drop_devices_failed_to_get_ts(timestamps):"},{"line_number":374,"context_line":"        \"\"\"Drop device information that failed to get timestamp"},{"line_number":375,"context_line":"        \"\"\""},{"line_number":376,"context_line":"        return {device: ts for device, ts in timestamps.items()"},{"line_number":377,"context_line":"                if ts is not None}"},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"    def scan_devices(self, previous, sync):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_d98baa1f","line":376,"updated":"2018-07-16 09:25:10.000000000","message":"this seems like a extra look. why not just prepare the set here? then you save a loop","commit_id":"92efc37d080597cee175cd085534b012679dd63d"},{"author":{"_account_id":14764,"name":"Yuki Nishiwaki","email":"uckey.1067@gmail.com","username":"ukinau"},"change_message_id":"373be87969922c7b93c147e1cbd9e316e4532224","unresolved":false,"context_lines":[{"line_number":373,"context_line":"    def _drop_devices_failed_to_get_ts(timestamps):"},{"line_number":374,"context_line":"        \"\"\"Drop device information that failed to get timestamp"},{"line_number":375,"context_line":"        \"\"\""},{"line_number":376,"context_line":"        return {device: ts for device, ts in timestamps.items()"},{"line_number":377,"context_line":"                if ts is not None}"},{"line_number":378,"context_line":""},{"line_number":379,"context_line":"    def scan_devices(self, previous, sync):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_4fc6e817","line":376,"in_reply_to":"5f7c97a3_d98baa1f","updated":"2018-07-16 11:29:04.000000000","message":"This loop is the logic to create dictionary only with the key that have timestamp information.\nIf we don\u0027t drop the timestamp key that has no information, scan_device will recognize the device as locally updated and removed, which is inconsistent.\nThat\u0027s why I introduced this loop and function. So I think this need.","commit_id":"92efc37d080597cee175cd085534b012679dd63d"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"ab36b912542976d516b8d06c5710281283ed8144","unresolved":false,"context_lines":[{"line_number":404,"context_line":""},{"line_number":405,"context_line":"        # drop the key for the device that failed to get timestamp"},{"line_number":406,"context_line":"        device_info[\u0027timestamps\u0027] \u003d self._drop_devices_failed_to_get_ts("},{"line_number":407,"context_line":"            device_info[\u0027timestamps\u0027])"},{"line_number":408,"context_line":"        # remove the devices that failed to get timestamps from current"},{"line_number":409,"context_line":"        device_info[\u0027current\u0027] -\u003d ("},{"line_number":410,"context_line":"                device_info[\u0027current\u0027] - set(device_info[\u0027timestamps\u0027].keys()))"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_91c96f7a","line":407,"updated":"2018-07-17 07:45:32.000000000","message":"Can\u0027t this filtering be done directly in self.mgr.get_devices_modified_timestamps() method: https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py#L673 ?","commit_id":"92efc37d080597cee175cd085534b012679dd63d"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"48b02b825bce9404a46b9ff4bea9b500ade19d66","unresolved":false,"context_lines":[{"line_number":395,"context_line":"        device_info[\u0027timestamps\u0027] \u003d self.mgr.get_devices_modified_timestamps("},{"line_number":396,"context_line":"            current_devices)"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"        # remove the devices that failed to get timestamps from current"},{"line_number":399,"context_line":"        device_info[\u0027current\u0027] -\u003d ("},{"line_number":400,"context_line":"                device_info[\u0027current\u0027] - set(device_info[\u0027timestamps\u0027].keys()))"},{"line_number":401,"context_line":""},{"line_number":402,"context_line":"        locally_updated \u003d self._get_devices_locally_modified("},{"line_number":403,"context_line":"            device_info[\u0027timestamps\u0027], previous[\u0027timestamps\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_b225ce18","line":400,"range":{"start_line":398,"start_character":0,"end_line":400,"end_character":79},"updated":"2018-07-25 06:12:43.000000000","message":"The macvtap returns {} as timestamps. Does this work fine?","commit_id":"4d9346c0cb24a6eed10817096208b751279b6308"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"0288848535fc80b2f3f8a83c132f05fc326bfe57","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        returned because this means it is new."},{"line_number":367,"context_line":"        \"\"\""},{"line_number":368,"context_line":"        return {device for device, timestamp in timestamps.items()"},{"line_number":369,"context_line":"                if device in previous_timestamps and"},{"line_number":370,"context_line":"                timestamp !\u003d previous_timestamps.get(device)}"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    def scan_devices(self, previous, sync):"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_fc71d846","line":369,"updated":"2018-07-25 08:33:53.000000000","message":"that is much cleaner solution than it was before :) Thx","commit_id":"b803195a9979f7b3b0fd9cea41699b33fc8cf2bb"}],"neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"b152290823ea32519fb9ef90074fe34a5e785d99","unresolved":false,"context_lines":[{"line_number":675,"context_line":"            ifindex \u003d bridge_lib.get_interface_ifindex(dev)"},{"line_number":676,"context_line":"            if ifindex is not None:"},{"line_number":677,"context_line":"                timestamps[dev] \u003d ifindex"},{"line_number":678,"context_line":"        return timestamps"},{"line_number":679,"context_line":""},{"line_number":680,"context_line":"    def get_all_devices(self):"},{"line_number":681,"context_line":"        devices \u003d set()"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_ceae0c7f","line":678,"updated":"2018-07-20 00:18:12.000000000","message":"If keeping it as a dictionary comprehension was important you could use something like:\n\n return {d: i for d, i in zip(devices, map(bridge_lib.get_interface_ifindex, devices))\n         if i is not None}\n\nThough that might be considered harder to maintain.","commit_id":"4d9346c0cb24a6eed10817096208b751279b6308"}]}
