)]}'
{"neutron/agent/linux/dhcp.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"9d066ff27a97ae014df0fdf850c0ca058f6cab9d","unresolved":false,"context_lines":[{"line_number":1097,"context_line":"                    port \u003d self.plugin.update_dhcp_port("},{"line_number":1098,"context_line":"                        port.id, {\u0027port\u0027: {\u0027network_id\u0027: network.id,"},{"line_number":1099,"context_line":"                                           \u0027device_id\u0027: device_id}})"},{"line_number":1100,"context_line":"                except oslo_messaging.RemoteError:"},{"line_number":1101,"context_line":"                    LOG.info(_LI(\"Skipping DHCP port %s\"), port.id)"},{"line_number":1102,"context_line":"                    continue"},{"line_number":1103,"context_line":"                if port:"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa80f949_9a459118","line":1100,"updated":"2015-11-05 11:44:03.000000000","message":"can you please check the exc_type of the RemoteError and make sure it\u0027s due to dhcp port in use? otherwise we should re-raise the exception I think.","commit_id":"96d440095177aee1ab38d5b8caefeb609037e42b"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"24e1955ee2cbf45c6ee90cc9186bdf74f796fcc9","unresolved":false,"context_lines":[{"line_number":1097,"context_line":"                    port \u003d self.plugin.update_dhcp_port("},{"line_number":1098,"context_line":"                        port.id, {\u0027port\u0027: {\u0027network_id\u0027: network.id,"},{"line_number":1099,"context_line":"                                           \u0027device_id\u0027: device_id}})"},{"line_number":1100,"context_line":"                except oslo_messaging.RemoteError:"},{"line_number":1101,"context_line":"                    LOG.info(_LI(\"Skipping DHCP port %s\"), port.id)"},{"line_number":1102,"context_line":"                    continue"},{"line_number":1103,"context_line":"                if port:"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa80f949_35fb56c3","line":1100,"in_reply_to":"fa80f949_9a459118","updated":"2015-11-05 12:10:21.000000000","message":"ok, makes sense","commit_id":"96d440095177aee1ab38d5b8caefeb609037e42b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"34621d983767a75e8b5e46e35061a4de37c62644","unresolved":false,"context_lines":[{"line_number":1099,"context_line":"                                           \u0027device_id\u0027: device_id}})"},{"line_number":1100,"context_line":"                except oslo_messaging.RemoteError as e:"},{"line_number":1101,"context_line":"                    if e.exc_type \u003d\u003d exceptions.DhcpPortInUse:"},{"line_number":1102,"context_line":"                        LOG.info(_LI(\"Skipping DHCP port %s\"), port.id)"},{"line_number":1103,"context_line":"                        continue"},{"line_number":1104,"context_line":"                    else:"},{"line_number":1105,"context_line":"                        raise e"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_973ce330","line":1102,"updated":"2015-11-16 11:59:47.000000000","message":"may also include the reason for skipping","commit_id":"8188edc8b129aa8db27fec80c395833e3fef13d9"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"4f65f5de71cf14505a8d5bcc6790392a9cfea16a","unresolved":false,"context_lines":[{"line_number":1099,"context_line":"                                           \u0027device_id\u0027: device_id}})"},{"line_number":1100,"context_line":"                except oslo_messaging.RemoteError as e:"},{"line_number":1101,"context_line":"                    if e.exc_type \u003d\u003d exceptions.DhcpPortInUse:"},{"line_number":1102,"context_line":"                        LOG.info(_LI(\"Skipping DHCP port %s\"), port.id)"},{"line_number":1103,"context_line":"                        continue"},{"line_number":1104,"context_line":"                    else:"},{"line_number":1105,"context_line":"                        raise e"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_0b820e53","line":1102,"in_reply_to":"ba8a016a_973ce330","updated":"2015-11-16 13:09:07.000000000","message":"Done","commit_id":"8188edc8b129aa8db27fec80c395833e3fef13d9"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"34621d983767a75e8b5e46e35061a4de37c62644","unresolved":false,"context_lines":[{"line_number":1102,"context_line":"                        LOG.info(_LI(\"Skipping DHCP port %s\"), port.id)"},{"line_number":1103,"context_line":"                        continue"},{"line_number":1104,"context_line":"                    else:"},{"line_number":1105,"context_line":"                        raise e"},{"line_number":1106,"context_line":"                if port:"},{"line_number":1107,"context_line":"                    return port"},{"line_number":1108,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_776dbf31","line":1105,"updated":"2015-11-16 11:59:47.000000000","message":"nit: \u0027else\u0027 not needed , \u0027e\u0027 not needed","commit_id":"8188edc8b129aa8db27fec80c395833e3fef13d9"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"4f65f5de71cf14505a8d5bcc6790392a9cfea16a","unresolved":false,"context_lines":[{"line_number":1102,"context_line":"                        LOG.info(_LI(\"Skipping DHCP port %s\"), port.id)"},{"line_number":1103,"context_line":"                        continue"},{"line_number":1104,"context_line":"                    else:"},{"line_number":1105,"context_line":"                        raise e"},{"line_number":1106,"context_line":"                if port:"},{"line_number":1107,"context_line":"                    return port"},{"line_number":1108,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_6bb63a3f","line":1105,"in_reply_to":"ba8a016a_776dbf31","updated":"2015-11-16 13:09:07.000000000","message":"ok.","commit_id":"8188edc8b129aa8db27fec80c395833e3fef13d9"}],"neutron/api/rpc/handlers/dhcp_rpc.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"1e172bd56ca82cd77bde83c76465ab1013c7eddb","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        if (old_port[\u0027device_id\u0027] !\u003d constants.DEVICE_ID_RESERVED_DHCP_PORT"},{"line_number":225,"context_line":"            and old_port[\u0027device_id\u0027] !\u003d"},{"line_number":226,"context_line":"            utils.get_dhcp_agent_device_id(port[\u0027port\u0027][\u0027network_id\u0027], host)):"},{"line_number":227,"context_line":"            raise n_exc.DhcpPortInUse(port_id\u003dport[\u0027id\u0027])"},{"line_number":228,"context_line":"        return self._port_action(plugin, context, port, \u0027update_port\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a26ad4f_2a8975c9","line":227,"updated":"2015-11-02 10:12:08.000000000","message":"isn\u0027t this still racy if you have multiple rpc workers?","commit_id":"96d440095177aee1ab38d5b8caefeb609037e42b"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5b4b4277c7551226c35dd11b1410fa346ef33081","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        if (old_port[\u0027device_id\u0027] !\u003d constants.DEVICE_ID_RESERVED_DHCP_PORT"},{"line_number":225,"context_line":"            and old_port[\u0027device_id\u0027] !\u003d"},{"line_number":226,"context_line":"            utils.get_dhcp_agent_device_id(port[\u0027port\u0027][\u0027network_id\u0027], host)):"},{"line_number":227,"context_line":"            raise n_exc.DhcpPortInUse(port_id\u003dport[\u0027id\u0027])"},{"line_number":228,"context_line":"        return self._port_action(plugin, context, port, \u0027update_port\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a26ad4f_9b124f56","line":227,"in_reply_to":"1a26ad4f_2a8975c9","updated":"2015-11-02 15:23:03.000000000","message":"Yes, it is still racy.\nHowever, the probability of the race is much much lower than it is right now.\nThe problem with existing code is that the period when race may happen may be tens of seconds for 50-100 networks.\nDHCP agents fetch reserved ports and keep them in memory for a long time - until they get to particular network in their full sync. During that time another agent will update the port while the first DHCP agent would not know.\n\nWith the new code the race is still possible, but it would require DHCP agents to make request for a port nearly at the same time, so average time period for a race is reduced to fractions of a second.","commit_id":"96d440095177aee1ab38d5b8caefeb609037e42b"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"8b48411266b859fec7525315a436419c2e5d9c38","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        if (old_port[\u0027device_id\u0027] !\u003d constants.DEVICE_ID_RESERVED_DHCP_PORT"},{"line_number":225,"context_line":"            and old_port[\u0027device_id\u0027] !\u003d"},{"line_number":226,"context_line":"            utils.get_dhcp_agent_device_id(port[\u0027port\u0027][\u0027network_id\u0027], host)):"},{"line_number":227,"context_line":"            raise n_exc.DhcpPortInUse(port_id\u003dport[\u0027id\u0027])"},{"line_number":228,"context_line":"        return self._port_action(plugin, context, port, \u0027update_port\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a26ad4f_fb0ecc8a","line":227,"in_reply_to":"1a26ad4f_9b124f56","updated":"2015-11-03 06:32:32.000000000","message":"Another optional solution could be creating specialized port_update method which would do \u0027true compare-and-swap\u0027 involving transaction but imo this is just unnecessarily complicated, considering that proposed solution makes race practically impossible.","commit_id":"96d440095177aee1ab38d5b8caefeb609037e42b"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"fa796b0b97fcac75fddf6421850087640279852d","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        if (old_port[\u0027device_id\u0027] !\u003d constants.DEVICE_ID_RESERVED_DHCP_PORT"},{"line_number":225,"context_line":"            and old_port[\u0027device_id\u0027] !\u003d"},{"line_number":226,"context_line":"            utils.get_dhcp_agent_device_id(port[\u0027port\u0027][\u0027network_id\u0027], host)):"},{"line_number":227,"context_line":"            raise n_exc.DhcpPortInUse(port_id\u003dport[\u0027id\u0027])"},{"line_number":228,"context_line":"        return self._port_action(plugin, context, port, \u0027update_port\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa80f949_f5d8abf1","line":227,"in_reply_to":"1a26ad4f_9b124f56","updated":"2015-11-04 03:43:33.000000000","message":"ok, i got it.  thank you.\ni agree it\u0027s an improvement.","commit_id":"96d440095177aee1ab38d5b8caefeb609037e42b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"34621d983767a75e8b5e46e35061a4de37c62644","unresolved":false,"context_lines":[{"line_number":214,"context_line":"        host \u003d kwargs.get(\u0027host\u0027)"},{"line_number":215,"context_line":"        port \u003d kwargs.get(\u0027port\u0027)"},{"line_number":216,"context_line":"        port[\u0027id\u0027] \u003d kwargs.get(\u0027port_id\u0027)"},{"line_number":217,"context_line":"        LOG.debug(\u0027Update dhcp port %(port)s \u0027"},{"line_number":218,"context_line":"                  \u0027from %(host)s.\u0027,"},{"line_number":219,"context_line":"                  {\u0027port\u0027: port,"},{"line_number":220,"context_line":"                   \u0027host\u0027: host})"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_d7ba6b6e","line":217,"updated":"2015-11-16 11:59:47.000000000","message":"better move logging after #227","commit_id":"8188edc8b129aa8db27fec80c395833e3fef13d9"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"4f65f5de71cf14505a8d5bcc6790392a9cfea16a","unresolved":false,"context_lines":[{"line_number":214,"context_line":"        host \u003d kwargs.get(\u0027host\u0027)"},{"line_number":215,"context_line":"        port \u003d kwargs.get(\u0027port\u0027)"},{"line_number":216,"context_line":"        port[\u0027id\u0027] \u003d kwargs.get(\u0027port_id\u0027)"},{"line_number":217,"context_line":"        LOG.debug(\u0027Update dhcp port %(port)s \u0027"},{"line_number":218,"context_line":"                  \u0027from %(host)s.\u0027,"},{"line_number":219,"context_line":"                  {\u0027port\u0027: port,"},{"line_number":220,"context_line":"                   \u0027host\u0027: host})"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba8a016a_eb80ea48","line":217,"in_reply_to":"ba8a016a_d7ba6b6e","updated":"2015-11-16 13:09:07.000000000","message":"Done","commit_id":"8188edc8b129aa8db27fec80c395833e3fef13d9"}],"neutron/tests/unit/api/rpc/handlers/test_dhcp_rpc.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5af86cf4dd46007bbcd56991111bbe5a127b4d2a","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            self.assertEqual(expected_port, port)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        self.plugin.get_port.return_value \u003d {"},{"line_number":182,"context_line":"            \u0027device_id\u0027: constants.DEVICE_ID_RESERVED_DHCP_PORT}"},{"line_number":183,"context_line":"        self.callbacks._port_action \u003d _fake_port_action"},{"line_number":184,"context_line":"        self.callbacks.update_dhcp_port(mock.Mock(),"},{"line_number":185,"context_line":"                                        host\u003d\u0027foo_host\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa80f949_6a24695f","line":182,"updated":"2015-11-06 11:21:13.000000000","message":"it should be the agent device id since here we are testing an update of the dhcp port when the port already exists, right?","commit_id":"8188edc8b129aa8db27fec80c395833e3fef13d9"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"11e20550d953d4b8b310e78b93bd1068a1da22c5","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            self.assertEqual(expected_port, port)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        self.plugin.get_port.return_value \u003d {"},{"line_number":182,"context_line":"            \u0027device_id\u0027: constants.DEVICE_ID_RESERVED_DHCP_PORT}"},{"line_number":183,"context_line":"        self.callbacks._port_action \u003d _fake_port_action"},{"line_number":184,"context_line":"        self.callbacks.update_dhcp_port(mock.Mock(),"},{"line_number":185,"context_line":"                                        host\u003d\u0027foo_host\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da85f559_e67824fb","line":182,"in_reply_to":"fa80f949_6a24695f","updated":"2015-11-07 02:34:07.000000000","message":"The usage here is similar to L233-234, so I think this is a trick to pass device_id checking in new added code.\n\nFor update_dhcp_port have two cases, existing port and reserved port, so I prefer separated tests for that in file.","commit_id":"8188edc8b129aa8db27fec80c395833e3fef13d9"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"00aa32a57e303fb204c02a8e13fc4bc19f5c05a1","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            self.assertEqual(expected_port, port)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        self.plugin.get_port.return_value \u003d {"},{"line_number":182,"context_line":"            \u0027device_id\u0027: constants.DEVICE_ID_RESERVED_DHCP_PORT}"},{"line_number":183,"context_line":"        self.callbacks._port_action \u003d _fake_port_action"},{"line_number":184,"context_line":"        self.callbacks.update_dhcp_port(mock.Mock(),"},{"line_number":185,"context_line":"                                        host\u003d\u0027foo_host\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da85f559_0e4d3a72","line":182,"in_reply_to":"fa80f949_6a24695f","updated":"2015-11-07 12:50:44.000000000","message":"here i would either need to costruct proper device_id for a port or provide \"reserved\" to avoid the check.","commit_id":"8188edc8b129aa8db27fec80c395833e3fef13d9"}]}
