)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The ML2 code is updated to use this new mechanism to prevent updating"},{"line_number":22,"context_line":"the port status to ACTIVE without both the DHCP agent and L2 agent"},{"line_number":23,"context_line":"reporting that the port is ready."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"The DHCP RPC API required a version bump to allow the port ready"},{"line_number":26,"context_line":"notification."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"1a122d0e_123210a7","line":23,"updated":"2016-04-20 17:35:13.000000000","message":"I think I can wrap my head around the synchronization logic between the various actors (plugin, dhcp agent and l2 agent), but a sequence diagram would definitely help better visualize what you put in code.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"The ML2 code is updated to use this new mechanism to prevent updating"},{"line_number":22,"context_line":"the port status to ACTIVE without both the DHCP agent and L2 agent"},{"line_number":23,"context_line":"reporting that the port is ready."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"The DHCP RPC API required a version bump to allow the port ready"},{"line_number":26,"context_line":"notification."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"1a122d0e_e4069a84","line":23,"updated":"2016-04-21 07:03:33.000000000","message":"ok. i\u0027ll put in a devref","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"}],"doc/source/devref/provisioning_blocks.rst":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"980db82a46f41c6dfdae3d61b4c0a401ec982db4","unresolved":false,"context_lines":[{"line_number":90,"context_line":"of ports from being transitioned to ACTIVE until both the L2 agent and"},{"line_number":91,"context_line":"the DHCP agent have finished wiring a port."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"When a port is created or updated, the following happens to register"},{"line_number":94,"context_line":"the DHCP agent\u0027s provisioning blocks:"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"1. The subnet_ids are extracted from the fixed_ips field of the port"}],"source_content_type":"text/x-rst","patch_set":26,"id":"dab17558_a7b415f2","line":93,"updated":"2016-05-13 22:57:41.000000000","message":"have you considered the situation where a create and update interleave?  And two add_provisioning_component calls on the same resource is attempted? The second one will obviously fail so my understanding from the code is that this is handled fine.\n\nOne other hand I think it is worth describing how ML2 supports other mech drivers (eg. those that do not rely on mech_agent). It seems to me that right now the code can easily handle the situation where the only provisioning block is the dhcp one, but I wonder if we want to be explicit in stating that the existing ML2 code will preserve its behavior prior to the introduction of this.","commit_id":"98b1588fab09799bb1dca3dfe97c2d6b62a41f96"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e26a2f02030b8ec43a36c6c68f0ce73c462ee7ef","unresolved":false,"context_lines":[{"line_number":90,"context_line":"of ports from being transitioned to ACTIVE until both the L2 agent and"},{"line_number":91,"context_line":"the DHCP agent have finished wiring a port."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"When a port is created or updated, the following happens to register"},{"line_number":94,"context_line":"the DHCP agent\u0027s provisioning blocks:"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"1. The subnet_ids are extracted from the fixed_ips field of the port"}],"source_content_type":"text/x-rst","patch_set":26,"id":"dab17558_c3c80d58","line":93,"in_reply_to":"dab17558_a7b415f2","updated":"2016-05-16 08:26:58.000000000","message":"Yes, if they interleave it\u0027s okay because it will just be idempotent. Since the agents react to the update as well as the create, they will clear it either way once they finish wiring.\n\nHowever, it is possible that the agent calling back to clear the create block will implicitly signal that the update was handled, which is not technically correct. \n\nSo potential order of bad events:\n\ncreate_port-\u003eadds block-\u003enotifies agents\n\nagents retrieve port and begin wiring\n\nupdate_port-\u003eadds block(noop)-\u003enotifies agents\n\nagents finish wiring first port state-\u003ecall server-\u003eprovisioning block cleared-\u003eport ACTIVE\n\nagents then handle port update\n\n\nIt is a shortcoming to not storing which particular thing needs to be acknowledged. However, the big undertaking to storing all of that doesn\u0027t seem to be worth this edge case of create port and then immediately change the IP.\n\n\n\nI\u0027ll add some words about previous code being backward compat.","commit_id":"98b1588fab09799bb1dca3dfe97c2d6b62a41f96"}],"etc/dhcp_agent.ini":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"97e7d8da26ac88ee115434e3766ab4a6a349d4a7","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"# Informs the Neutron server that the port status should not be transitioned"},{"line_number":40,"context_line":"# to ACTIVE until the DHCP wiring is completed for this port."},{"line_number":41,"context_line":"# notifies_port_ready \u003d True"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"# In some cases the neutron router is not present to provide the metadata"},{"line_number":44,"context_line":"# IP but the DHCP server can be used to provide this info. Setting this"}],"source_content_type":"text/x-properties","patch_set":12,"id":"ba15a1d1_983fb1b3","line":41,"updated":"2015-09-23 17:43:50.000000000","message":"I\u0027m wondering whether another configuration option is really necessary for this functionality? I mean, is there ever a time when we *don\u0027t* want the port to wait to be ACTIVE unti DHCP wiring is completed (assuming the port needs DHCP wiring of course)?","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"03fe5afbdd3cdf59b3a106a577bfb70eba9f7c12","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"# Informs the Neutron server that the port status should not be transitioned"},{"line_number":40,"context_line":"# to ACTIVE until the DHCP wiring is completed for this port."},{"line_number":41,"context_line":"# notifies_port_ready \u003d True"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"# In some cases the neutron router is not present to provide the metadata"},{"line_number":44,"context_line":"# IP but the DHCP server can be used to provide this info. Setting this"}],"source_content_type":"text/x-properties","patch_set":12,"id":"ba15a1d1_8b22fa52","line":41,"in_reply_to":"ba15a1d1_983fb1b3","updated":"2015-09-23 19:14:43.000000000","message":"This was a way to turn it off if problems arise since the target was to ship with liberty. Now that it\u0027s not in Liberty it\u0027s probably pointless.","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"}],"neutron/agent/dhcp/agent.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"cc672ec5610c37ab4bea6ca48cbcf53f55ceff7b","unresolved":false,"context_lines":[{"line_number":464,"context_line":"                          network_id\u003dnetwork_id, subnet_id\u003dsubnet_id,"},{"line_number":465,"context_line":"                          device_id\u003ddevice_id, host\u003dself.host)"},{"line_number":466,"context_line":""},{"line_number":467,"context_line":"    def allow_port_up(self, port_id):"},{"line_number":468,"context_line":"        \"\"\"Notify the server that DHCP is configured for the port.\"\"\""},{"line_number":469,"context_line":"        cctxt \u003d self.client.prepare(version\u003d\u00271.2\u0027)"},{"line_number":470,"context_line":"        return cctxt.call(self.context, \u0027allow_port_up\u0027, port_id\u003dport_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_254d593e","line":467,"updated":"2015-08-19 07:35:33.000000000","message":"What do you think about: port_dhcp_ready, this way we\u0027re more explicit about  the source and reason of the event.\n\nI\u0027m wondering if we\u0027d ever have other sources for synchronization before port UP ?","commit_id":"a2aa616746fcc4d1ae5dc3ef7766941534e24c41"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"9e1f9bfce19c49e9badb9e8a348e8358365434fd","unresolved":false,"context_lines":[{"line_number":464,"context_line":"                          network_id\u003dnetwork_id, subnet_id\u003dsubnet_id,"},{"line_number":465,"context_line":"                          device_id\u003ddevice_id, host\u003dself.host)"},{"line_number":466,"context_line":""},{"line_number":467,"context_line":"    def allow_port_up(self, port_id):"},{"line_number":468,"context_line":"        \"\"\"Notify the server that DHCP is configured for the port.\"\"\""},{"line_number":469,"context_line":"        cctxt \u003d self.client.prepare(version\u003d\u00271.2\u0027)"},{"line_number":470,"context_line":"        return cctxt.call(self.context, \u0027allow_port_up\u0027, port_id\u003dport_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_1e6f462c","line":467,"in_reply_to":"fa1b9901_254d593e","updated":"2015-08-19 08:42:31.000000000","message":"Done","commit_id":"a2aa616746fcc4d1ae5dc3ef7766941534e24c41"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"99ad9c7b2239c23ecd72982497e6007e859e94a1","unresolved":false,"context_lines":[{"line_number":334,"context_line":"                    driver_action \u003d \u0027restart\u0027"},{"line_number":335,"context_line":"            self.cache.put_port(updated_port)"},{"line_number":336,"context_line":"            self.call_driver(driver_action, network)"},{"line_number":337,"context_line":"            # TODO(kevinbenton): consider batching these if they cause"},{"line_number":338,"context_line":"            # a performance problem."},{"line_number":339,"context_line":"            self.plugin_rpc.dhcp_ready_on_ports([updated_port.id])"},{"line_number":340,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_d10d51e9","line":337,"updated":"2015-09-10 03:50:33.000000000","message":"Yeah, I think this may be problematic at scale, but batching will delay when a port can get to ACTIVE, so this is a bit of a sticking point.\n\n/me mumbles...","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"271ac80ca81ab3381267782c3f8cbf5aed38a5dc","unresolved":false,"context_lines":[{"line_number":465,"context_line":"            cctxt \u003d self.client.prepare(version\u003d\u00271.3\u0027)"},{"line_number":466,"context_line":"            return cctxt.cast(self.context, \u0027dhcp_ready_on_ports\u0027,"},{"line_number":467,"context_line":"                              port_ids\u003dport_ids)"},{"line_number":468,"context_line":"        except oslo_messaging.UnsupportedVersion:"},{"line_number":469,"context_line":"            # if server doesn\u0027t support this, we don\u0027t need to do anything"},{"line_number":470,"context_line":"            # because the port status doesn\u0027t depend on us"},{"line_number":471,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_bee5d638","line":468,"updated":"2015-09-16 15:01:10.000000000","message":"I don\u0027t believe adding compatibility code like that buys anything: it\u0027s not expected that old server works with new agents, and should not be expected.\n\nI know it\u0027s not the first patch that adds such compat code. I need to write up some page in devref on upgrade...","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":465,"context_line":"            cctxt \u003d self.client.prepare(version\u003d\u00271.3\u0027)"},{"line_number":466,"context_line":"            return cctxt.cast(self.context, \u0027dhcp_ready_on_ports\u0027,"},{"line_number":467,"context_line":"                              port_ids\u003dport_ids)"},{"line_number":468,"context_line":"        except oslo_messaging.UnsupportedVersion:"},{"line_number":469,"context_line":"            # if server doesn\u0027t support this, we don\u0027t need to do anything"},{"line_number":470,"context_line":"            # because the port status doesn\u0027t depend on us"},{"line_number":471,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_3aeb207a","line":468,"in_reply_to":"ba15a1d1_bee5d638","updated":"2015-09-23 01:23:57.000000000","message":"ok. i\u0027ll remove it. Seeing code like this is what causes the confusion on which way we need to be compatible in the first place.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"99ad9c7b2239c23ecd72982497e6007e859e94a1","unresolved":false,"context_lines":[{"line_number":561,"context_line":"            \u0027host\u0027: host,"},{"line_number":562,"context_line":"            \u0027topic\u0027: topics.DHCP_AGENT,"},{"line_number":563,"context_line":"            \u0027configurations\u0027: {"},{"line_number":564,"context_line":"                \u0027notifies_port_ready\u0027: True,"},{"line_number":565,"context_line":"                \u0027dhcp_driver\u0027: self.conf.dhcp_driver,"},{"line_number":566,"context_line":"                \u0027use_namespaces\u0027: self.conf.use_namespaces,"},{"line_number":567,"context_line":"                \u0027dhcp_lease_duration\u0027: self.conf.dhcp_lease_duration,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_51194121","line":564,"updated":"2015-09-10 03:50:33.000000000","message":"I wonder if we should make this tunable...\n\n/me mumbles...","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":561,"context_line":"            \u0027host\u0027: host,"},{"line_number":562,"context_line":"            \u0027topic\u0027: topics.DHCP_AGENT,"},{"line_number":563,"context_line":"            \u0027configurations\u0027: {"},{"line_number":564,"context_line":"                \u0027notifies_port_ready\u0027: True,"},{"line_number":565,"context_line":"                \u0027dhcp_driver\u0027: self.conf.dhcp_driver,"},{"line_number":566,"context_line":"                \u0027use_namespaces\u0027: self.conf.use_namespaces,"},{"line_number":567,"context_line":"                \u0027dhcp_lease_duration\u0027: self.conf.dhcp_lease_duration,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_baf73058","line":564,"in_reply_to":"da20952f_51194121","updated":"2015-09-23 01:23:57.000000000","message":"I think for this late in the cycle, yes but only for only the DHCP agent. Then if we find there is some scaling issue we can advise to turn it off.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"363a87c44a9bf46c7d081e8caa8f6a7adad12154","unresolved":false,"context_lines":[{"line_number":340,"context_line":"            self.call_driver(driver_action, network)"},{"line_number":341,"context_line":"            # TODO(kevinbenton): consider batching these if they cause"},{"line_number":342,"context_line":"            # a performance problem."},{"line_number":343,"context_line":"            self.plugin_rpc.dhcp_ready_on_ports([updated_port.id])"},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"    def _is_port_on_this_agent(self, port):"},{"line_number":346,"context_line":"        thishost \u003d utils.get_dhcp_agent_device_id("}],"source_content_type":"text/x-python","patch_set":8,"id":"ba15a1d1_3cd319d7","line":343,"updated":"2015-09-23 05:49:56.000000000","message":"+1 for making the call accept a list from the start :)","commit_id":"1c12023174c34f976e23b3687f2180fe0760c4d3"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8321bdbded43828b9907d715e48251336d38550c","unresolved":false,"context_lines":[{"line_number":348,"context_line":"        # Use the update handler for the port create event."},{"line_number":349,"context_line":"        self.port_update_end(context, payload)"},{"line_number":350,"context_line":"        # TODO(kevinbenton): consider batching these if they cause"},{"line_number":351,"context_line":"        # a performance problem."},{"line_number":352,"context_line":"        self.plugin_rpc.dhcp_ready_on_ports([payload[\u0027port\u0027][\u0027id\u0027]])"},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"    @utils.synchronized(\u0027dhcp-agent\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_85952534","line":351,"updated":"2015-09-23 10:31:13.000000000","message":"if self.conf.notifies_port_ready?","commit_id":"1509190dd426927f4e58dd340caabc4980e088a5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"0c5375d489b4a239b770686c884f65296a79e885","unresolved":false,"context_lines":[{"line_number":348,"context_line":"        # Use the update handler for the port create event."},{"line_number":349,"context_line":"        self.port_update_end(context, payload)"},{"line_number":350,"context_line":"        # TODO(kevinbenton): consider batching these if they cause"},{"line_number":351,"context_line":"        # a performance problem."},{"line_number":352,"context_line":"        self.plugin_rpc.dhcp_ready_on_ports([payload[\u0027port\u0027][\u0027id\u0027]])"},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"    @utils.synchronized(\u0027dhcp-agent\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_f427ed0f","line":351,"in_reply_to":"ba15a1d1_85952534","updated":"2015-09-23 13:58:36.000000000","message":"Done","commit_id":"1509190dd426927f4e58dd340caabc4980e088a5"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ee6608a104d5bdc600e3e0cb7ed3be4c8e33984a","unresolved":false,"context_lines":[{"line_number":337,"context_line":"                if old_ips !\u003d new_ips:"},{"line_number":338,"context_line":"                    driver_action \u003d \u0027restart\u0027"},{"line_number":339,"context_line":"            self.cache.put_port(updated_port)"},{"line_number":340,"context_line":"            self.call_driver(driver_action, network)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    def _is_port_on_this_agent(self, port):"},{"line_number":343,"context_line":"        thishost \u003d utils.get_dhcp_agent_device_id("}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_404a9427","line":340,"updated":"2015-09-23 11:29:09.000000000","message":"super pedant comment: in case of ip changes technically the DHCP is not ready to serve that port. A barrier should probably be added here too. Indeed until the DHCP server is updated a DHCPDISCOVER from that port will not cause a DHCPOFFER for the new address. Is this analysis correct?","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2ae57329a1fab139afd3bcd8ac99af312c760a7e","unresolved":false,"context_lines":[{"line_number":337,"context_line":"                if old_ips !\u003d new_ips:"},{"line_number":338,"context_line":"                    driver_action \u003d \u0027restart\u0027"},{"line_number":339,"context_line":"            self.cache.put_port(updated_port)"},{"line_number":340,"context_line":"            self.call_driver(driver_action, network)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    def _is_port_on_this_agent(self, port):"},{"line_number":343,"context_line":"        thishost \u003d utils.get_dhcp_agent_device_id("}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_4edac54c","line":340,"in_reply_to":"ba15a1d1_404a9427","updated":"2015-09-23 13:42:46.000000000","message":"This is true and I will make a note to do it in a follow up. However, it doesn\u0027t gain us much because the VM is usually already running at that point.","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0b44560dad42178499dc4669513a525d23e552f4","unresolved":false,"context_lines":[{"line_number":337,"context_line":"                if old_ips !\u003d new_ips:"},{"line_number":338,"context_line":"                    driver_action \u003d \u0027restart\u0027"},{"line_number":339,"context_line":"            self.cache.put_port(updated_port)"},{"line_number":340,"context_line":"            self.call_driver(driver_action, network)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"    def _is_port_on_this_agent(self, port):"},{"line_number":343,"context_line":"        thishost \u003d utils.get_dhcp_agent_device_id("}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_cb1ebc6f","line":340,"in_reply_to":"ba15a1d1_4edac54c","updated":"2015-09-23 15:31:01.000000000","message":"indeed. That\u0027s why I wrote that this was a pedant comment.","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ee6608a104d5bdc600e3e0cb7ed3be4c8e33984a","unresolved":false,"context_lines":[{"line_number":349,"context_line":"        self.port_update_end(context, payload)"},{"line_number":350,"context_line":"        # TODO(kevinbenton): consider batching these if they cause"},{"line_number":351,"context_line":"        # a performance problem."},{"line_number":352,"context_line":"        self.plugin_rpc.dhcp_ready_on_ports([payload[\u0027port\u0027][\u0027id\u0027]])"},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"    @utils.synchronized(\u0027dhcp-agent\u0027)"},{"line_number":355,"context_line":"    def port_delete_end(self, context, payload):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_002fbc88","line":352,"updated":"2015-09-23 11:29:09.000000000","message":"what would you batch? And how? That could lead to starvation imho","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5837741d2c756a30ebf74a9d69ab21b30cc3e823","unresolved":false,"context_lines":[{"line_number":349,"context_line":"        self.port_update_end(context, payload)"},{"line_number":350,"context_line":"        # TODO(kevinbenton): consider batching these if they cause"},{"line_number":351,"context_line":"        # a performance problem."},{"line_number":352,"context_line":"        self.plugin_rpc.dhcp_ready_on_ports([payload[\u0027port\u0027][\u0027id\u0027]])"},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"    @utils.synchronized(\u0027dhcp-agent\u0027)"},{"line_number":355,"context_line":"    def port_delete_end(self, context, payload):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_09d0471e","line":352,"in_reply_to":"ba15a1d1_002fbc88","updated":"2015-09-23 13:06:15.000000000","message":"Batch port_update_end and dhcp_ready_on_ports?","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2ae57329a1fab139afd3bcd8ac99af312c760a7e","unresolved":false,"context_lines":[{"line_number":349,"context_line":"        self.port_update_end(context, payload)"},{"line_number":350,"context_line":"        # TODO(kevinbenton): consider batching these if they cause"},{"line_number":351,"context_line":"        # a performance problem."},{"line_number":352,"context_line":"        self.plugin_rpc.dhcp_ready_on_ports([payload[\u0027port\u0027][\u0027id\u0027]])"},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"    @utils.synchronized(\u0027dhcp-agent\u0027)"},{"line_number":355,"context_line":"    def port_delete_end(self, context, payload):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_e355f21d","line":352,"in_reply_to":"ba15a1d1_002fbc88","updated":"2015-09-23 13:42:46.000000000","message":"i envision a queue would fill and empty every 250ms or whatever","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"0b44560dad42178499dc4669513a525d23e552f4","unresolved":false,"context_lines":[{"line_number":349,"context_line":"        self.port_update_end(context, payload)"},{"line_number":350,"context_line":"        # TODO(kevinbenton): consider batching these if they cause"},{"line_number":351,"context_line":"        # a performance problem."},{"line_number":352,"context_line":"        self.plugin_rpc.dhcp_ready_on_ports([payload[\u0027port\u0027][\u0027id\u0027]])"},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"    @utils.synchronized(\u0027dhcp-agent\u0027)"},{"line_number":355,"context_line":"    def port_delete_end(self, context, payload):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_6b41b062","line":352,"in_reply_to":"ba15a1d1_e355f21d","updated":"2015-09-23 15:31:01.000000000","message":"ah ok. In this way you will prevent starvation.\nYou just have to do an estimate on whether the expected gain is worth the pain of implementing the queue.","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"97e7d8da26ac88ee115434e3766ab4a6a349d4a7","unresolved":false,"context_lines":[{"line_number":348,"context_line":"        # TODO(kevinbenton): add a barrier when the IP changes for"},{"line_number":349,"context_line":"        # DHCP as well. The VM is already running so it isn\u0027t critical."},{"line_number":350,"context_line":"        # Use the update handler for the port create event."},{"line_number":351,"context_line":"        self.port_update_end(context, payload)"},{"line_number":352,"context_line":"        if not self.conf.notifies_port_ready:"},{"line_number":353,"context_line":"            return"},{"line_number":354,"context_line":"        # TODO(kevinbenton): consider batching these if they cause"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_d8a6890e","line":351,"updated":"2015-09-23 17:43:50.000000000","message":"Shouldn\u0027t this be place **after** the call to self.plugin_rpc.dhcp_ready_on_ports()? Alternately, shouldn\u0027t the port_update_end() call be made from the Neutron server endpoint that is notified by the call to dhcp_ready_on_ports(), since that is a cast() instead of a call(), and if port_update_end() runs here, there is a chance that the port will be updated even if the dhcp_ready_on_ports() function fails for some reason?","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"03fe5afbdd3cdf59b3a106a577bfb70eba9f7c12","unresolved":false,"context_lines":[{"line_number":348,"context_line":"        # TODO(kevinbenton): add a barrier when the IP changes for"},{"line_number":349,"context_line":"        # DHCP as well. The VM is already running so it isn\u0027t critical."},{"line_number":350,"context_line":"        # Use the update handler for the port create event."},{"line_number":351,"context_line":"        self.port_update_end(context, payload)"},{"line_number":352,"context_line":"        if not self.conf.notifies_port_ready:"},{"line_number":353,"context_line":"            return"},{"line_number":354,"context_line":"        # TODO(kevinbenton): consider batching these if they cause"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_8bb0bafe","line":351,"in_reply_to":"ba15a1d1_d8a6890e","updated":"2015-09-23 19:14:43.000000000","message":"This name is a little misleading out of context. This port_update_end is the function that is called from neutron when it finishes updating a port, so this is what triggers all of the setup of the dnsmasq options, etc. That\u0027s why we want to make sure it\u0027s done before we call dhcp_ready_on_ports which notifies the server that we are done.\n\nIf we called dhcp_ready_on_ports first, then we would still have a race condition because we are telling the server we are done before we actually are.","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1b09677e6aaddc82acffdb9d0def63f1964e3fea","unresolved":false,"context_lines":[{"line_number":352,"context_line":"        if not self.conf.notifies_port_ready:"},{"line_number":353,"context_line":"            return"},{"line_number":354,"context_line":"        # TODO(kevinbenton): consider batching these if they cause"},{"line_number":355,"context_line":"        # a performance problem."},{"line_number":356,"context_line":"        self.plugin_rpc.dhcp_ready_on_ports([payload[\u0027port\u0027][\u0027id\u0027]])"},{"line_number":357,"context_line":""},{"line_number":358,"context_line":"    @utils.synchronized(\u0027dhcp-agent\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_cbc23ce9","line":355,"updated":"2015-09-25 21:08:23.000000000","message":"Any thoughts on the likelihood that this will cause a performance problem?  Obviously, you think it is a possibility because you added the comment here.  I just ask because RC1 is a bad time to introduce code you think may cause a performance problem.","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"5a3b2320c7c8b867805594f15608de8b9c8d5eb8","unresolved":false,"context_lines":[{"line_number":168,"context_line":"                        network.id in only_nets):  # specific network to sync"},{"line_number":169,"context_line":"                    pool.spawn(self.safe_configure_dhcp_for_network, network)"},{"line_number":170,"context_line":"            pool.waitall()"},{"line_number":171,"context_line":"            port_ids \u003d self.cache.get_port_ids()"},{"line_number":172,"context_line":"            # we notify all ports in case some were created while the agent"},{"line_number":173,"context_line":"            # was down"},{"line_number":174,"context_line":"            self.plugin_rpc.dhcp_ready_on_ports(port_ids)"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_e8ce2459","line":171,"updated":"2016-04-18 06:14:12.000000000","message":"in line 143 we are blocking. if this is thousands of ports can it be a problem?","commit_id":"6cd73cb3b280420ab740f9da7c69dd4e741f0078"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"fc66e0e8926ef38e31ccd7edf5966fe23aab6330","unresolved":false,"context_lines":[{"line_number":168,"context_line":"                        network.id in only_nets):  # specific network to sync"},{"line_number":169,"context_line":"                    pool.spawn(self.safe_configure_dhcp_for_network, network)"},{"line_number":170,"context_line":"            pool.waitall()"},{"line_number":171,"context_line":"            port_ids \u003d self.cache.get_port_ids()"},{"line_number":172,"context_line":"            # we notify all ports in case some were created while the agent"},{"line_number":173,"context_line":"            # was down"},{"line_number":174,"context_line":"            self.plugin_rpc.dhcp_ready_on_ports(port_ids)"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_ebe8a3e4","line":171,"in_reply_to":"1a122d0e_e8ce2459","updated":"2016-04-19 09:40:14.000000000","message":"I can push this to a separate background thread so the agent isn\u0027t slowed down by this. This doesn\u0027t matter for the ML2 plugin since the ports will now wait until this report before allowing Nova to boot, but it could be an issue if a plugin is used that doesn\u0027t implement the provisioning blocks for DHCP.","commit_id":"6cd73cb3b280420ab740f9da7c69dd4e741f0078"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":193,"context_line":"                port_id \u003d self.dhcp_ready_ports.pop()"},{"line_number":194,"context_line":"                # we are currently doing these one at a time to spread"},{"line_number":195,"context_line":"                # processing across all Neutron servers at the cost of"},{"line_number":196,"context_line":"                # more messages. We could bulk if necessary."},{"line_number":197,"context_line":"                try:"},{"line_number":198,"context_line":"                    self.plugin_rpc.dhcp_ready_on_ports([port_id])"},{"line_number":199,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_04b2b6e4","line":196,"updated":"2016-04-21 07:03:33.000000000","message":"Sure, the only other downside is that if there is an error, it means we have to retry them all rather than just one. However, that\u0027s a pretty small corner case probably not worth optimizing.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":193,"context_line":"                port_id \u003d self.dhcp_ready_ports.pop()"},{"line_number":194,"context_line":"                # we are currently doing these one at a time to spread"},{"line_number":195,"context_line":"                # processing across all Neutron servers at the cost of"},{"line_number":196,"context_line":"                # more messages. We could bulk if necessary."},{"line_number":197,"context_line":"                try:"},{"line_number":198,"context_line":"                    self.plugin_rpc.dhcp_ready_on_ports([port_id])"},{"line_number":199,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_b1707e0c","line":196,"updated":"2016-04-20 17:35:13.000000000","message":"bulk may introduce delays, though I don\u0027t see why we couldn\u0027t drain the entire set, after all we surely have than one dhcp agent dealing with its own ports and that should naturally leverage the load sharing of the message bus?","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":195,"context_line":"                # processing across all Neutron servers at the cost of"},{"line_number":196,"context_line":"                # more messages. We could bulk if necessary."},{"line_number":197,"context_line":"                try:"},{"line_number":198,"context_line":"                    self.plugin_rpc.dhcp_ready_on_ports([port_id])"},{"line_number":199,"context_line":"                except Exception:"},{"line_number":200,"context_line":"                    LOG.exception(_LE(\"Failure notifying DHCP server of \""},{"line_number":201,"context_line":"                                      \"ready DHCP port %s. Will retry on next \""}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_64cd6a65","line":198,"updated":"2016-04-21 07:03:33.000000000","message":"Is newer agents with an older server something we do support? If so, I can certainly catch a notsupported exception, break out of the loop, and set the flag that says this doesn\u0027t report port ready events.\n\nIf the plugin doesn\u0027t implement the RPC API defined in neutron/api/rpc/handlers/dhcp_rpc.py then I would say that\u0027s their problem. This agent is designed to work with that specific RPC API, if they want to use this agent, they should import that handler on the server side.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":195,"context_line":"                # processing across all Neutron servers at the cost of"},{"line_number":196,"context_line":"                # more messages. We could bulk if necessary."},{"line_number":197,"context_line":"                try:"},{"line_number":198,"context_line":"                    self.plugin_rpc.dhcp_ready_on_ports([port_id])"},{"line_number":199,"context_line":"                except Exception:"},{"line_number":200,"context_line":"                    LOG.exception(_LE(\"Failure notifying DHCP server of \""},{"line_number":201,"context_line":"                                      \"ready DHCP port %s. Will retry on next \""}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_e67b5ebc","line":198,"updated":"2016-04-20 17:35:13.000000000","message":"if this is a new RPC call, we\u0027d need to accommodate that the server you\u0027re talking to is not able to serve it, whether because it\u0027s older than Newton (though it\u0027s a case we don\u0027t usually support) or because for whatever reason the plugin doesn\u0027t implement it. Have you considered these two cases?","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":196,"context_line":"                # more messages. We could bulk if necessary."},{"line_number":197,"context_line":"                try:"},{"line_number":198,"context_line":"                    self.plugin_rpc.dhcp_ready_on_ports([port_id])"},{"line_number":199,"context_line":"                except Exception:"},{"line_number":200,"context_line":"                    LOG.exception(_LE(\"Failure notifying DHCP server of \""},{"line_number":201,"context_line":"                                      \"ready DHCP port %s. Will retry on next \""},{"line_number":202,"context_line":"                                      \"iteration.\"), port_id)"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_26cd5631","line":199,"updated":"2016-04-20 17:35:13.000000000","message":"I appreciate that we need the widest catch to avoid killing the thread, but can\u0027t we narrow it down so that we log at exception level only when we don\u0027t recognize any error condition rather than known ones (like Timeout exception)?","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":196,"context_line":"                # more messages. We could bulk if necessary."},{"line_number":197,"context_line":"                try:"},{"line_number":198,"context_line":"                    self.plugin_rpc.dhcp_ready_on_ports([port_id])"},{"line_number":199,"context_line":"                except Exception:"},{"line_number":200,"context_line":"                    LOG.exception(_LE(\"Failure notifying DHCP server of \""},{"line_number":201,"context_line":"                                      \"ready DHCP port %s. Will retry on next \""},{"line_number":202,"context_line":"                                      \"iteration.\"), port_id)"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_44c82e55","line":199,"updated":"2016-04-21 07:03:33.000000000","message":"Sure, I\u0027ll catch timeout exception separately.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":503,"context_line":""},{"line_number":504,"context_line":"    def dhcp_ready_on_ports(self, port_ids):"},{"line_number":505,"context_line":"        \"\"\"Notify the server that DHCP is configured for the port.\"\"\""},{"line_number":506,"context_line":"        cctxt \u003d self.client.prepare(version\u003d\u00271.5\u0027)"},{"line_number":507,"context_line":"        return cctxt.cast(self.context, \u0027dhcp_ready_on_ports\u0027,"},{"line_number":508,"context_line":"                          port_ids\u003dport_ids)"},{"line_number":509,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_a4c30237","line":506,"updated":"2016-04-21 07:03:33.000000000","message":"That\u0027s because the server side has already gone up through 1.4.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":503,"context_line":""},{"line_number":504,"context_line":"    def dhcp_ready_on_ports(self, port_ids):"},{"line_number":505,"context_line":"        \"\"\"Notify the server that DHCP is configured for the port.\"\"\""},{"line_number":506,"context_line":"        cctxt \u003d self.client.prepare(version\u003d\u00271.5\u0027)"},{"line_number":507,"context_line":"        return cctxt.cast(self.context, \u0027dhcp_ready_on_ports\u0027,"},{"line_number":508,"context_line":"                          port_ids\u003dport_ids)"},{"line_number":509,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_31d3ce61","line":506,"updated":"2016-04-20 17:35:13.000000000","message":"that\u0027s a big jump","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":505,"context_line":"        \"\"\"Notify the server that DHCP is configured for the port.\"\"\""},{"line_number":506,"context_line":"        cctxt \u003d self.client.prepare(version\u003d\u00271.5\u0027)"},{"line_number":507,"context_line":"        return cctxt.cast(self.context, \u0027dhcp_ready_on_ports\u0027,"},{"line_number":508,"context_line":"                          port_ids\u003dport_ids)"},{"line_number":509,"context_line":""},{"line_number":510,"context_line":""},{"line_number":511,"context_line":"class NetworkCache(object):"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_d1489ab5","line":508,"updated":"2016-04-20 17:35:13.000000000","message":"I wonder what happens if for some reason, the messages are not delivered, is there a chance the state transition never happens?","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":505,"context_line":"        \"\"\"Notify the server that DHCP is configured for the port.\"\"\""},{"line_number":506,"context_line":"        cctxt \u003d self.client.prepare(version\u003d\u00271.5\u0027)"},{"line_number":507,"context_line":"        return cctxt.cast(self.context, \u0027dhcp_ready_on_ports\u0027,"},{"line_number":508,"context_line":"                          port_ids\u003dport_ids)"},{"line_number":509,"context_line":""},{"line_number":510,"context_line":""},{"line_number":511,"context_line":"class NetworkCache(object):"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_84bec6ab","line":508,"updated":"2016-04-21 07:03:33.000000000","message":"Oh sorry, good catch. This was supposed to be a call so we get an error if it fails. Otherwise yes, a message could be lost and we wouldn\u0027t know.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"dcf6409361bd3c55de9838a85c3d963404c8d1d8","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                                     \"notifications. Disabling notifier.\"))"},{"line_number":205,"context_line":"                        if hasattr(self, \u0027agent_state\u0027):"},{"line_number":206,"context_line":"                            config \u003d self.agent_state[\u0027configurations\u0027]"},{"line_number":207,"context_line":"                            config[\u0027notifies_port_ready\u0027] \u003d False"},{"line_number":208,"context_line":"                        return"},{"line_number":209,"context_line":"                    LOG.exception(_LE(\"Failure notifying DHCP server of \""},{"line_number":210,"context_line":"                                      \"ready DHCP ports. Will retry on next \""}],"source_content_type":"text/x-python","patch_set":23,"id":"1a122d0e_b1aaec83","line":207,"updated":"2016-04-22 04:01:06.000000000","message":"This release note will be out of place though, no? It\u0027s my understanding that we have always assumed the server will be upgraded first so we don\u0027t make any effort to check behavior of the agents when running on an old server. Is that not correct?\n\nI can also just adjust this to not return and instead sleep for 5 minutes or something and try again if we do want this to be compatible.","commit_id":"a72ed8b245c3d724f200949acd1095eec4d49238"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"00f7a8b1626e630dbb4331781c5fdcbbfd838ecc","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                                     \"notifications. Disabling notifier.\"))"},{"line_number":205,"context_line":"                        if hasattr(self, \u0027agent_state\u0027):"},{"line_number":206,"context_line":"                            config \u003d self.agent_state[\u0027configurations\u0027]"},{"line_number":207,"context_line":"                            config[\u0027notifies_port_ready\u0027] \u003d False"},{"line_number":208,"context_line":"                        return"},{"line_number":209,"context_line":"                    LOG.exception(_LE(\"Failure notifying DHCP server of \""},{"line_number":210,"context_line":"                                      \"ready DHCP ports. Will retry on next \""}],"source_content_type":"text/x-python","patch_set":23,"id":"1a122d0e_1902f96f","line":207,"updated":"2016-04-21 17:30:30.000000000","message":"if notifies_port_ready becomes false, do we break out of the loop? Even if we don\u0027t, would we ever get it back to True if the server is refreshed?\n\nTo go back to your answer. I appreciate that we always prescribed that the server upgrades first, and if we want to go by this assumption this recovery logic may not be needed and that\u0027s fine by me. Having said that this means that we clearly need to release note this.","commit_id":"a72ed8b245c3d724f200949acd1095eec4d49238"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"b695c15f933a85cf3c0bf95edb10deac163475cc","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                                     \"notifications. Disabling notifier.\"))"},{"line_number":205,"context_line":"                        if hasattr(self, \u0027agent_state\u0027):"},{"line_number":206,"context_line":"                            config \u003d self.agent_state[\u0027configurations\u0027]"},{"line_number":207,"context_line":"                            config[\u0027notifies_port_ready\u0027] \u003d False"},{"line_number":208,"context_line":"                        return"},{"line_number":209,"context_line":"                    LOG.exception(_LE(\"Failure notifying DHCP server of \""},{"line_number":210,"context_line":"                                      \"ready DHCP ports. Will retry on next \""}],"source_content_type":"text/x-python","patch_set":23,"id":"1a122d0e_f79bbc70","line":207,"in_reply_to":"1a122d0e_1902f96f","updated":"2016-04-21 23:05:15.000000000","message":"Yes, we break from the loop by returning early. It will never recover until restart if the server is finally updated. Everything will still work because the server checks for \u0027notifies_port_ready\u0027, they just won\u0027t get the race condition solved until they restart the DHCP agent again.\n\nWhat are we release noting in this case? The forward compatibility this agent provides?","commit_id":"a72ed8b245c3d724f200949acd1095eec4d49238"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"42c087c8c71d55c31d5a76151c21ddc59caffdc0","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                                     \"notifications. Disabling notifier.\"))"},{"line_number":205,"context_line":"                        if hasattr(self, \u0027agent_state\u0027):"},{"line_number":206,"context_line":"                            config \u003d self.agent_state[\u0027configurations\u0027]"},{"line_number":207,"context_line":"                            config[\u0027notifies_port_ready\u0027] \u003d False"},{"line_number":208,"context_line":"                        return"},{"line_number":209,"context_line":"                    LOG.exception(_LE(\"Failure notifying DHCP server of \""},{"line_number":210,"context_line":"                                      \"ready DHCP ports. Will retry on next \""}],"source_content_type":"text/x-python","patch_set":23,"id":"1a122d0e_a0dc5c47","line":207,"in_reply_to":"1a122d0e_f79bbc70","updated":"2016-04-22 01:06:46.000000000","message":"ok, so this needs a restart, it\u0027s not like intelligently discovers that the server has upgraded. If you think this is too complicated then we can embed the assumption that the server must be upgraded first (i.e. go back to your previous PS), and release note that the Newton DHCP agent will emit (non-fatal) errors (maybe warnings?) if working with a pre-Newton server.","commit_id":"a72ed8b245c3d724f200949acd1095eec4d49238"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"dcf6409361bd3c55de9838a85c3d963404c8d1d8","unresolved":false,"context_lines":[{"line_number":512,"context_line":"    def dhcp_ready_on_ports(self, port_ids):"},{"line_number":513,"context_line":"        \"\"\"Notify the server that DHCP is configured for the port.\"\"\""},{"line_number":514,"context_line":"        cctxt \u003d self.client.prepare(version\u003d\u00271.5\u0027)"},{"line_number":515,"context_line":"        return cctxt.call(self.context, \u0027dhcp_ready_on_ports\u0027,"},{"line_number":516,"context_line":"                          port_ids\u003dport_ids)"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"1a122d0e_91aff093","line":515,"updated":"2016-04-22 04:01:06.000000000","message":"Yeah, I think this should just be addressed by the sane backoff stuff. Even if a timeout does occur, the next attempt will be faster for all of the ports that have been marked as ACTIVE since it won\u0027t result in an update the second time around.","commit_id":"a72ed8b245c3d724f200949acd1095eec4d49238"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"00f7a8b1626e630dbb4331781c5fdcbbfd838ecc","unresolved":false,"context_lines":[{"line_number":512,"context_line":"    def dhcp_ready_on_ports(self, port_ids):"},{"line_number":513,"context_line":"        \"\"\"Notify the server that DHCP is configured for the port.\"\"\""},{"line_number":514,"context_line":"        cctxt \u003d self.client.prepare(version\u003d\u00271.5\u0027)"},{"line_number":515,"context_line":"        return cctxt.call(self.context, \u0027dhcp_ready_on_ports\u0027,"},{"line_number":516,"context_line":"                          port_ids\u003dport_ids)"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"1a122d0e_b9f14598","line":515,"updated":"2016-04-21 17:30:30.000000000","message":"wouldn\u0027t that potentially make the whole thing less scalable? I know it\u0027s a trade off.","commit_id":"a72ed8b245c3d724f200949acd1095eec4d49238"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"42c087c8c71d55c31d5a76151c21ddc59caffdc0","unresolved":false,"context_lines":[{"line_number":512,"context_line":"    def dhcp_ready_on_ports(self, port_ids):"},{"line_number":513,"context_line":"        \"\"\"Notify the server that DHCP is configured for the port.\"\"\""},{"line_number":514,"context_line":"        cctxt \u003d self.client.prepare(version\u003d\u00271.5\u0027)"},{"line_number":515,"context_line":"        return cctxt.call(self.context, \u0027dhcp_ready_on_ports\u0027,"},{"line_number":516,"context_line":"                          port_ids\u003dport_ids)"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"1a122d0e_e0cdb487","line":515,"in_reply_to":"1a122d0e_9798886c","updated":"2016-04-22 01:06:46.000000000","message":"I mean, this could potentially go in timeout if the server is really backed up, ports might pile up and and we\u0027ll keep hammering the server (hopefully the backoff client will help when that comes to fruition). I don\u0027t believe the order of magnitude is ever going to be a problem at scale, do you?\n\nA cast (async) approach would solve the problem as the server would consume messages according to its own pace. We\u0027d lose the delivery guarantee given by a call paradigm, which we would need to make up for with other acks of some sorts...so this gets complicated either way.","commit_id":"a72ed8b245c3d724f200949acd1095eec4d49238"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"b695c15f933a85cf3c0bf95edb10deac163475cc","unresolved":false,"context_lines":[{"line_number":512,"context_line":"    def dhcp_ready_on_ports(self, port_ids):"},{"line_number":513,"context_line":"        \"\"\"Notify the server that DHCP is configured for the port.\"\"\""},{"line_number":514,"context_line":"        cctxt \u003d self.client.prepare(version\u003d\u00271.5\u0027)"},{"line_number":515,"context_line":"        return cctxt.call(self.context, \u0027dhcp_ready_on_ports\u0027,"},{"line_number":516,"context_line":"                          port_ids\u003dport_ids)"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"1a122d0e_9798886c","line":515,"in_reply_to":"1a122d0e_b9f14598","updated":"2016-04-21 23:05:15.000000000","message":"No, this is happening in a background eventlet loop on the agent so it\u0027s not blocking anything. If the server is slow processing things, it won\u0027t matter if these are calls/casts when it comes to the time it takes for a port to become ACTIVE. Also, by blocking on the call we also get the benefit of batching up more ready port_ids while this waits to finish.","commit_id":"a72ed8b245c3d724f200949acd1095eec4d49238"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"806b678860ca2994beae82f3f0069d77ef09de56","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        \"\"\"Activate the DHCP agent.\"\"\""},{"line_number":99,"context_line":"        self.sync_state()"},{"line_number":100,"context_line":"        self.periodic_resync()"},{"line_number":101,"context_line":"        self.start_ready_ports_pusher()"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def call_driver(self, action, network, **action_kwargs):"},{"line_number":104,"context_line":"        \"\"\"Invoke an action on a DHCP driver instance.\"\"\""}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_e57feca8","line":101,"updated":"2016-05-10 21:28:07.000000000","message":"!~!~!~!~!~!~!~!\n\nDone","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5469f01a3bb7a73df5d7487f597ab719270922e2","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        \"\"\"Activate the DHCP agent.\"\"\""},{"line_number":99,"context_line":"        self.sync_state()"},{"line_number":100,"context_line":"        self.periodic_resync()"},{"line_number":101,"context_line":"        self.start_ready_ports_pusher()"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def call_driver(self, action, network, **action_kwargs):"},{"line_number":104,"context_line":"        \"\"\"Invoke an action on a DHCP driver instance.\"\"\""}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_87c78311","line":101,"updated":"2016-05-07 00:52:43.000000000","message":"can we use a different name? I don\u0027t want to be associated to illegal activities [1]?\n\n[1] http://dictionary.cambridge.org/dictionary/english/pusher","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"806b678860ca2994beae82f3f0069d77ef09de56","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                            and e.exc_type \u003d\u003d \u0027NoSuchMethod\u0027):"},{"line_number":204,"context_line":"                        LOG.info(_LI(\"Server does not support port ready \""},{"line_number":205,"context_line":"                                     \"notifications. Disabling notifier.\"))"},{"line_number":206,"context_line":"                        if hasattr(self, \u0027agent_state\u0027):"},{"line_number":207,"context_line":"                            config \u003d self.agent_state[\u0027configurations\u0027]"},{"line_number":208,"context_line":"                            config[\u0027notifies_port_ready\u0027] \u003d False"},{"line_number":209,"context_line":"                        return"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_c57c68b7","line":206,"updated":"2016-05-10 21:28:07.000000000","message":"This junk can go away. I\u0027m reverting back to just having it take a nap for a while if the server doesn\u0027t support the method and then retrying.","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5469f01a3bb7a73df5d7487f597ab719270922e2","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                            and e.exc_type \u003d\u003d \u0027NoSuchMethod\u0027):"},{"line_number":204,"context_line":"                        LOG.info(_LI(\"Server does not support port ready \""},{"line_number":205,"context_line":"                                     \"notifications. Disabling notifier.\"))"},{"line_number":206,"context_line":"                        if hasattr(self, \u0027agent_state\u0027):"},{"line_number":207,"context_line":"                            config \u003d self.agent_state[\u0027configurations\u0027]"},{"line_number":208,"context_line":"                            config[\u0027notifies_port_ready\u0027] \u003d False"},{"line_number":209,"context_line":"                        return"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_07dc33e3","line":206,"updated":"2016-05-07 00:52:43.000000000","message":"is the use of hasattr needed because at this time the dealing of drugs the agent state may not exist yet? That\u0027s pretty nasty. Would you mind not do that?","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"}],"neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1247dbe7ce033f50d62f5cddc5d716bbeb136148","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            enabled_agents \u003d self._get_enabled_agents("},{"line_number":141,"context_line":"                context, network, agents, method, payload)"},{"line_number":142,"context_line":"            if (method \u003d\u003d \u0027port_create_end\u0027 and"},{"line_number":143,"context_line":"                    any(self.plugin.get_configuration_dict(agent).get("},{"line_number":144,"context_line":"                            \u0027notifies_port_ready\u0027)"},{"line_number":145,"context_line":"                        for agent in enabled_agents)):"},{"line_number":146,"context_line":"                # at least one of the agents tells us when the dhcp config"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_d0bd4069","line":143,"updated":"2015-09-16 15:58:20.000000000","message":"I\u0027m trying to figure out why \"any\".  What if the particular agent responsible for the port doesn\u0027t notify?  Will it never go active?  Maybe I just haven\u0027t fully wrapped my head around this yet.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f3a49959e922d5e0a9e44d3d3a622ea06b6a88ca","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            enabled_agents \u003d self._get_enabled_agents("},{"line_number":141,"context_line":"                context, network, agents, method, payload)"},{"line_number":142,"context_line":"            if (method \u003d\u003d \u0027port_create_end\u0027 and"},{"line_number":143,"context_line":"                    any(self.plugin.get_configuration_dict(agent).get("},{"line_number":144,"context_line":"                            \u0027notifies_port_ready\u0027)"},{"line_number":145,"context_line":"                        for agent in enabled_agents)):"},{"line_number":146,"context_line":"                # at least one of the agents tells us when the dhcp config"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_2b7978c8","line":143,"in_reply_to":"ba15a1d1_6888f371","updated":"2015-09-25 21:08:33.000000000","message":"that makes sense","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            enabled_agents \u003d self._get_enabled_agents("},{"line_number":141,"context_line":"                context, network, agents, method, payload)"},{"line_number":142,"context_line":"            if (method \u003d\u003d \u0027port_create_end\u0027 and"},{"line_number":143,"context_line":"                    any(self.plugin.get_configuration_dict(agent).get("},{"line_number":144,"context_line":"                            \u0027notifies_port_ready\u0027)"},{"line_number":145,"context_line":"                        for agent in enabled_agents)):"},{"line_number":146,"context_line":"                # at least one of the agents tells us when the dhcp config"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_6888f371","line":143,"in_reply_to":"ba15a1d1_d0bd4069","updated":"2015-09-23 01:23:57.000000000","message":"These are all of the agents a network is scheduled to. When a network is scheduled to multiple agents, all of the agents setup a reservation for every port. So as long as one of them is notifying, we will receive a notification.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"99ad9c7b2239c23ecd72982497e6007e859e94a1","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                    any(self.plugin.get_configuration_dict(agent).get("},{"line_number":144,"context_line":"                            \u0027notifies_port_ready\u0027)"},{"line_number":145,"context_line":"                        for agent in enabled_agents)):"},{"line_number":146,"context_line":"                # at least one of the agents tells us when the dhcp config"},{"line_number":147,"context_line":"                # is ready so we set a status barrier to prevent the port"},{"line_number":148,"context_line":"                # from going ACTIVE until this notification is received."},{"line_number":149,"context_line":"                status_barriers.add_object_status_barrier("}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_d1db114e","line":146,"updated":"2015-09-10 03:50:33.000000000","message":"the wording feels funny here: this is actually\n\nat least one of the agents WILL tell us when dhcp config is ready.\n\nAs at this point the dhcp agent hasn\u0027t told you anything.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                    any(self.plugin.get_configuration_dict(agent).get("},{"line_number":144,"context_line":"                            \u0027notifies_port_ready\u0027)"},{"line_number":145,"context_line":"                        for agent in enabled_agents)):"},{"line_number":146,"context_line":"                # at least one of the agents tells us when the dhcp config"},{"line_number":147,"context_line":"                # is ready so we set a status barrier to prevent the port"},{"line_number":148,"context_line":"                # from going ACTIVE until this notification is received."},{"line_number":149,"context_line":"                status_barriers.add_object_status_barrier("}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_2828bb32","line":146,"in_reply_to":"da20952f_d1db114e","updated":"2015-09-23 01:23:57.000000000","message":"Done","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"271ac80ca81ab3381267782c3f8cbf5aed38a5dc","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                # is ready so we set a status barrier to prevent the port"},{"line_number":148,"context_line":"                # from going ACTIVE until this notification is received."},{"line_number":149,"context_line":"                status_barriers.add_object_status_barrier("},{"line_number":150,"context_line":"                    context, \u0027dhcp\u0027, resources.PORT, payload[\u0027port\u0027][\u0027id\u0027],"},{"line_number":151,"context_line":"                    \u0027ACTIVE\u0027)"},{"line_number":152,"context_line":"            for agent in enabled_agents:"},{"line_number":153,"context_line":"                self._cast_message("}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_03cd8d65","line":150,"updated":"2015-09-16 15:01:10.000000000","message":"\u0027dhcp\u0027 should we have that moved into some constant like DHCP_PORT_BARRIER_ENTITY?","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                # is ready so we set a status barrier to prevent the port"},{"line_number":148,"context_line":"                # from going ACTIVE until this notification is received."},{"line_number":149,"context_line":"                status_barriers.add_object_status_barrier("},{"line_number":150,"context_line":"                    context, \u0027dhcp\u0027, resources.PORT, payload[\u0027port\u0027][\u0027id\u0027],"},{"line_number":151,"context_line":"                    \u0027ACTIVE\u0027)"},{"line_number":152,"context_line":"            for agent in enabled_agents:"},{"line_number":153,"context_line":"                self._cast_message("}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_88bb070f","line":150,"in_reply_to":"ba15a1d1_03cd8d65","updated":"2015-09-23 01:23:57.000000000","message":"Done","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"271ac80ca81ab3381267782c3f8cbf5aed38a5dc","unresolved":false,"context_lines":[{"line_number":148,"context_line":"                # from going ACTIVE until this notification is received."},{"line_number":149,"context_line":"                status_barriers.add_object_status_barrier("},{"line_number":150,"context_line":"                    context, \u0027dhcp\u0027, resources.PORT, payload[\u0027port\u0027][\u0027id\u0027],"},{"line_number":151,"context_line":"                    \u0027ACTIVE\u0027)"},{"line_number":152,"context_line":"            for agent in enabled_agents:"},{"line_number":153,"context_line":"                self._cast_message("},{"line_number":154,"context_line":"                    context, method, payload, agent.host, agent.topic)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_63ea49ae","line":151,"updated":"2015-09-16 15:01:10.000000000","message":"PORT_STATUS_ACTIVE?","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":148,"context_line":"                # from going ACTIVE until this notification is received."},{"line_number":149,"context_line":"                status_barriers.add_object_status_barrier("},{"line_number":150,"context_line":"                    context, \u0027dhcp\u0027, resources.PORT, payload[\u0027port\u0027][\u0027id\u0027],"},{"line_number":151,"context_line":"                    \u0027ACTIVE\u0027)"},{"line_number":152,"context_line":"            for agent in enabled_agents:"},{"line_number":153,"context_line":"                self._cast_message("},{"line_number":154,"context_line":"                    context, method, payload, agent.host, agent.topic)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_a8b84b12","line":151,"in_reply_to":"ba15a1d1_63ea49ae","updated":"2015-09-23 01:23:57.000000000","message":"Done","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ee6608a104d5bdc600e3e0cb7ed3be4c8e33984a","unresolved":false,"context_lines":[{"line_number":142,"context_line":"            if (method \u003d\u003d \u0027port_create_end\u0027 and"},{"line_number":143,"context_line":"                    any(self.plugin.get_configuration_dict(agent).get("},{"line_number":144,"context_line":"                            \u0027notifies_port_ready\u0027)"},{"line_number":145,"context_line":"                        for agent in enabled_agents)):"},{"line_number":146,"context_line":"                # at least one of the agents will tell us when the dhcp config"},{"line_number":147,"context_line":"                # is ready so we set a status barrier to prevent the port"},{"line_number":148,"context_line":"                # from going ACTIVE until this notification is received."}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_83b2f6e3","line":145,"updated":"2015-09-23 11:29:09.000000000","message":"dropping a random question here.\nWhat if we have a plugin that uses the DHCP Agent, is not ML2, and has not implemented support for barriers?\n\nBy tuning notifies_port_ready to False everything should be fine. But since it defaults to True, will there be troubles on upgrade if one does not take appropriate steps to update the configuration before doing the upgrade?","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2ae57329a1fab139afd3bcd8ac99af312c760a7e","unresolved":false,"context_lines":[{"line_number":142,"context_line":"            if (method \u003d\u003d \u0027port_create_end\u0027 and"},{"line_number":143,"context_line":"                    any(self.plugin.get_configuration_dict(agent).get("},{"line_number":144,"context_line":"                            \u0027notifies_port_ready\u0027)"},{"line_number":145,"context_line":"                        for agent in enabled_agents)):"},{"line_number":146,"context_line":"                # at least one of the agents will tell us when the dhcp config"},{"line_number":147,"context_line":"                # is ready so we set a status barrier to prevent the port"},{"line_number":148,"context_line":"                # from going ACTIVE until this notification is received."}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_8ede9d0f","line":145,"in_reply_to":"ba15a1d1_83b2f6e3","updated":"2015-09-23 13:42:46.000000000","message":"No big issue. If it\u0027s not ML2 it won\u0027t honor the barrier. It will just set them here and then clear them in dhcp_rpc.py to no effect.","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"df23507d5163d581e43e5783982ae447c2b1ecab","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                # notification is received."},{"line_number":164,"context_line":"                provisioning_blocks.add_provisioning_component("},{"line_number":165,"context_line":"                    context, payload[\u0027port\u0027][\u0027id\u0027], resources.PORT,"},{"line_number":166,"context_line":"                    provisioning_blocks.DHCP_ENTITY)"},{"line_number":167,"context_line":"            for agent in enabled_agents:"},{"line_number":168,"context_line":"                self._cast_message("},{"line_number":169,"context_line":"                    context, method, payload, agent.host, agent.topic)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_a8c1f530","line":166,"updated":"2016-04-15 15:11:21.000000000","message":"Consider adding all provisioning blocks synchronously with ML2 operations (a minor corollary is that plugins that do not use these block but use the DHCP agent will be adding a lot of cruft to the provisioning blocks table)","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"107ce5497e4b9f0395cb38ebf64bbba73c4f2cea","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                # notification is received."},{"line_number":164,"context_line":"                provisioning_blocks.add_provisioning_component("},{"line_number":165,"context_line":"                    context, payload[\u0027port\u0027][\u0027id\u0027], resources.PORT,"},{"line_number":166,"context_line":"                    provisioning_blocks.DHCP_ENTITY)"},{"line_number":167,"context_line":"            for agent in enabled_agents:"},{"line_number":168,"context_line":"                self._cast_message("},{"line_number":169,"context_line":"                    context, method, payload, agent.host, agent.topic)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_ee1655a6","line":166,"in_reply_to":"1a122d0e_a8c1f530","updated":"2016-04-15 15:58:09.000000000","message":"good point.","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"}],"neutron/api/rpc/handlers/dhcp_rpc.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"45646ba3effb9a5cfbb7aaf263648ad1ab06fb5e","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":314,"context_line":"        return self._port_action(plugin, context, port, \u0027update_port\u0027)"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    def allow_port_up(self, context, port_id):"},{"line_number":317,"context_line":"        status_barriers.satisfy_object_status_barrier("},{"line_number":318,"context_line":"            context, \u0027dhcp\u0027, port_id, constants.PORT_STATUS_ACTIVE)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a0c5dc1_18feba6b","line":316,"updated":"2015-05-12 21:05:34.000000000","message":"Please see:\nhttps://review.openstack.org/#/c/182449/","commit_id":"a2aa616746fcc4d1ae5dc3ef7766941534e24c41"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"cc672ec5610c37ab4bea6ca48cbcf53f55ceff7b","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":314,"context_line":"        return self._port_action(plugin, context, port, \u0027update_port\u0027)"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    def allow_port_up(self, context, port_id):"},{"line_number":317,"context_line":"        status_barriers.satisfy_object_status_barrier("},{"line_number":318,"context_line":"            context, \u0027dhcp\u0027, port_id, constants.PORT_STATUS_ACTIVE)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_c5d7bd21","line":316,"in_reply_to":"9a0c5dc1_18feba6b","updated":"2015-08-19 07:35:33.000000000","message":"Hmm, makes sense to not be synchronous from agent side on this.","commit_id":"a2aa616746fcc4d1ae5dc3ef7766941534e24c41"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"9e1f9bfce19c49e9badb9e8a348e8358365434fd","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":314,"context_line":"        return self._port_action(plugin, context, port, \u0027update_port\u0027)"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    def allow_port_up(self, context, port_id):"},{"line_number":317,"context_line":"        status_barriers.satisfy_object_status_barrier("},{"line_number":318,"context_line":"            context, \u0027dhcp\u0027, port_id, constants.PORT_STATUS_ACTIVE)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_be641a49","line":316,"in_reply_to":"fa1b9901_c5d7bd21","updated":"2015-08-19 08:42:31.000000000","message":"Done","commit_id":"a2aa616746fcc4d1ae5dc3ef7766941534e24c41"}],"neutron/db/migration/alembic_migrations/versions/liberty/expand/30107ab6a3ee_status_barriers.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"271ac80ca81ab3381267782c3f8cbf5aed38a5dc","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                  primary_key\u003dTrue),"},{"line_number":38,"context_line":"        sa.Column(\u0027status\u0027, sa.String(length\u003d32), nullable\u003dFalse,"},{"line_number":39,"context_line":"                  primary_key\u003dTrue),"},{"line_number":40,"context_line":"        sa.Column(\u0027object_type\u0027, sa.String(36))"},{"line_number":41,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_b2918df3","line":40,"updated":"2015-09-16 15:01:10.000000000","message":"How does it play with neutronobjects table that you introduce in a separate patch? Should we then kill object_type?\n\nArmando, you forced me to spend more time on that file than needed. That\u0027s because I was failing to stop thinking what you could mean!.. Wait, here it is again... What did he mean?..","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"99ad9c7b2239c23ecd72982497e6007e859e94a1","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                  primary_key\u003dTrue),"},{"line_number":38,"context_line":"        sa.Column(\u0027status\u0027, sa.String(length\u003d32), nullable\u003dFalse,"},{"line_number":39,"context_line":"                  primary_key\u003dTrue),"},{"line_number":40,"context_line":"        sa.Column(\u0027object_type\u0027, sa.String(36))"},{"line_number":41,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_91e6f914","line":40,"updated":"2015-09-10 03:50:33.000000000","message":"regarding this and tags...do that thingy will you?\n\nWARNING to other reviewers: Kevin knows what I am talking about...you may wondering what it is.....well you\u0027ll have to wait...","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                  primary_key\u003dTrue),"},{"line_number":38,"context_line":"        sa.Column(\u0027status\u0027, sa.String(length\u003d32), nullable\u003dFalse,"},{"line_number":39,"context_line":"                  primary_key\u003dTrue),"},{"line_number":40,"context_line":"        sa.Column(\u0027object_type\u0027, sa.String(36))"},{"line_number":41,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_48d40f1f","line":40,"in_reply_to":"ba15a1d1_b2918df3","updated":"2015-09-23 01:23:57.000000000","message":"That patch is currently engulfed in performance concerns so I will proceed with this thing for now and migrate if we can merge the other one in the future.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1247dbe7ce033f50d62f5cddc5d716bbeb136148","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                  primary_key\u003dTrue),"},{"line_number":38,"context_line":"        sa.Column(\u0027status\u0027, sa.String(length\u003d32), nullable\u003dFalse,"},{"line_number":39,"context_line":"                  primary_key\u003dTrue),"},{"line_number":40,"context_line":"        sa.Column(\u0027object_type\u0027, sa.String(36))"},{"line_number":41,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_19d3e005","line":40,"in_reply_to":"da20952f_91e6f914","updated":"2015-09-16 15:58:20.000000000","message":"I can\u0027t wait.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"363a87c44a9bf46c7d081e8caa8f6a7adad12154","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                  primary_key\u003dTrue),"},{"line_number":38,"context_line":"        sa.Column(\u0027status\u0027, sa.String(length\u003d32), nullable\u003dFalse,"},{"line_number":39,"context_line":"                  primary_key\u003dTrue),"},{"line_number":40,"context_line":"        sa.Column(\u0027object_type\u0027, sa.String(36))"},{"line_number":41,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba15a1d1_1c0f353a","line":40,"updated":"2015-09-23 05:49:56.000000000","message":"shouldn\u0027t the lookup fields be also indexed individually?, I\u0027m not sure if making them a PK all together makes a single index for the tuple making the PK, thus slowing down lookups on single columns (like object_id)","commit_id":"1c12023174c34f976e23b3687f2180fe0760c4d3"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"12a4b349784e578134fd1b55621698b7252f250b","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                  primary_key\u003dTrue),"},{"line_number":38,"context_line":"        sa.Column(\u0027status\u0027, sa.String(length\u003d32), nullable\u003dFalse,"},{"line_number":39,"context_line":"                  primary_key\u003dTrue),"},{"line_number":40,"context_line":"        sa.Column(\u0027object_type\u0027, sa.String(36))"},{"line_number":41,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba15a1d1_fdcfdb53","line":40,"in_reply_to":"ba15a1d1_17806ebe","updated":"2015-09-23 08:21:04.000000000","message":"That makes sense, I\u0027m wondering if it makes sense to add a timestamp at least.\n\nThis way we can add something to remove very old entries. Otherwise, we could eventually pile up left overs.","commit_id":"1c12023174c34f976e23b3687f2180fe0760c4d3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"7c15ae787e4e700e211838287889c9cf3234aa25","unresolved":false,"context_lines":[{"line_number":37,"context_line":"                  primary_key\u003dTrue),"},{"line_number":38,"context_line":"        sa.Column(\u0027status\u0027, sa.String(length\u003d32), nullable\u003dFalse,"},{"line_number":39,"context_line":"                  primary_key\u003dTrue),"},{"line_number":40,"context_line":"        sa.Column(\u0027object_type\u0027, sa.String(36))"},{"line_number":41,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba15a1d1_17806ebe","line":40,"in_reply_to":"ba15a1d1_1c0f353a","updated":"2015-09-23 06:43:58.000000000","message":"I think we can revisit this later. This table should stay really small since it\u0027s only the objects in active transition.","commit_id":"1c12023174c34f976e23b3687f2180fe0760c4d3"}],"neutron/db/migration/alembic_migrations/versions/newton/expand/30107ab6a3ee_provisioning_blocks.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":35,"context_line":"                  sa.ForeignKey(\u0027standardattributes.id\u0027, ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":36,"context_line":"                  nullable\u003dFalse, primary_key\u003dTrue),"},{"line_number":37,"context_line":"        sa.Column(\u0027entity\u0027, sa.String(length\u003d255), nullable\u003dFalse,"},{"line_number":38,"context_line":"                  primary_key\u003dTrue),"},{"line_number":39,"context_line":"        sa.Column(\u0027object_type\u0027, sa.String(255), nullable\u003dFalse),"},{"line_number":40,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_c409de96","line":38,"updated":"2016-04-21 07:03:33.000000000","message":"No, because a single standard attr ID will have multiple different entities (e.g. a single port will have L2 agent and DHCP). Likewise a single entity will be blocking many things (e.g. DHCP is pending for 1000 ports).","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":35,"context_line":"                  sa.ForeignKey(\u0027standardattributes.id\u0027, ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":36,"context_line":"                  nullable\u003dFalse, primary_key\u003dTrue),"},{"line_number":37,"context_line":"        sa.Column(\u0027entity\u0027, sa.String(length\u003d255), nullable\u003dFalse,"},{"line_number":38,"context_line":"                  primary_key\u003dTrue),"},{"line_number":39,"context_line":"        sa.Column(\u0027object_type\u0027, sa.String(255), nullable\u003dFalse),"},{"line_number":40,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_116972f9","line":38,"updated":"2016-04-20 17:35:13.000000000","message":"isn\u0027t standard_attr_id enough as primary key or entity but not both?","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"}],"neutron/db/provisioning_blocks.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"df23507d5163d581e43e5783982ae447c2b1ecab","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"1a122d0e_68ffdd34","updated":"2016-04-15 15:11:21.000000000","message":"I suspect it might not be a bad idea to have a method to expire blocks or clearly identify blocks which are \"stale\" (ie: created for an operation that failed and never removed)","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"17274c0a6d43bedccf5ae52ef1e24537e2013870","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"1a122d0e_daf985ca","in_reply_to":"1a122d0e_1981594b","updated":"2016-04-15 21:41:02.000000000","message":"Yes, that should be good enough given their temporary nature","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"107ce5497e4b9f0395cb38ebf64bbba73c4f2cea","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"1a122d0e_1981594b","in_reply_to":"1a122d0e_68ffdd34","updated":"2016-04-15 15:58:09.000000000","message":"Perhaps on any port update I can clear them out.","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"df23507d5163d581e43e5783982ae447c2b1ecab","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    # NOTE(kevinbenton): this is hacky because it assumes the table name"},{"line_number":46,"context_line":"    # is the plural form of the callback topic. We can allow explicit"},{"line_number":47,"context_line":"    # table names as an optional argument in the future if necessary."},{"line_number":48,"context_line":"    table \u003d \u0027%ss\u0027 % object_type"},{"line_number":49,"context_line":"    model \u003d model_base.BASEV2.metadata.tables.get(table)"},{"line_number":50,"context_line":"    if model is None:"},{"line_number":51,"context_line":"        raise RuntimeError(\"Could not find table for %s\" % object_type)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_e1cf8db1","line":48,"updated":"2016-04-15 15:11:21.000000000","message":"Are you sure this is safe for resources with custom table names (there a few)","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"17274c0a6d43bedccf5ae52ef1e24537e2013870","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    # NOTE(kevinbenton): this is hacky because it assumes the table name"},{"line_number":46,"context_line":"    # is the plural form of the callback topic. We can allow explicit"},{"line_number":47,"context_line":"    # table names as an optional argument in the future if necessary."},{"line_number":48,"context_line":"    table \u003d \u0027%ss\u0027 % object_type"},{"line_number":49,"context_line":"    model \u003d model_base.BASEV2.metadata.tables.get(table)"},{"line_number":50,"context_line":"    if model is None:"},{"line_number":51,"context_line":"        raise RuntimeError(\"Could not find table for %s\" % object_type)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_fa00c1ac","line":48,"in_reply_to":"1a122d0e_190e7934","updated":"2016-04-15 21:41:02.000000000","message":"makes sense (sorry I completely missed your comment above line 48)","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"107ce5497e4b9f0395cb38ebf64bbba73c4f2cea","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    # NOTE(kevinbenton): this is hacky because it assumes the table name"},{"line_number":46,"context_line":"    # is the plural form of the callback topic. We can allow explicit"},{"line_number":47,"context_line":"    # table names as an optional argument in the future if necessary."},{"line_number":48,"context_line":"    table \u003d \u0027%ss\u0027 % object_type"},{"line_number":49,"context_line":"    model \u003d model_base.BASEV2.metadata.tables.get(table)"},{"line_number":50,"context_line":"    if model is None:"},{"line_number":51,"context_line":"        raise RuntimeError(\"Could not find table for %s\" % object_type)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_190e7934","line":48,"in_reply_to":"1a122d0e_e1cf8db1","updated":"2016-04-15 15:58:09.000000000","message":"I figured I would just start with this and then if someone comes in with a use case for another resource with a custom table name we can come up with a way to make this more explicit.","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"df23507d5163d581e43e5783982ae447c2b1ecab","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        if record:"},{"line_number":93,"context_line":"            context.session.delete(record)"},{"line_number":94,"context_line":"            LOG.debug(\"Provisioning for %(otype)s %(oid)s completed by entity \""},{"line_number":95,"context_line":"                      \"%(entity)s.\", log_dict)"},{"line_number":96,"context_line":"    # now with that committed, check if any records are left. if None, emit"},{"line_number":97,"context_line":"    # an event that provisioning is complete. Note that two threads could"},{"line_number":98,"context_line":"    # reach this conclusion at the same time so subscribers to this callback"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_c820b1fa","line":95,"updated":"2016-04-15 15:11:21.000000000","message":"Would it be possible to just call delete and check how many records were deleted?","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"825e1f80c4fa2ad34866330d9c3c1cb1fa2f20f9","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        if record:"},{"line_number":93,"context_line":"            context.session.delete(record)"},{"line_number":94,"context_line":"            LOG.debug(\"Provisioning for %(otype)s %(oid)s completed by entity \""},{"line_number":95,"context_line":"                      \"%(entity)s.\", log_dict)"},{"line_number":96,"context_line":"    # now with that committed, check if any records are left. if None, emit"},{"line_number":97,"context_line":"    # an event that provisioning is complete. Note that two threads could"},{"line_number":98,"context_line":"    # reach this conclusion at the same time so subscribers to this callback"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_8b7341b1","line":95,"in_reply_to":"1a122d0e_3aa6b9c1","updated":"2016-04-15 23:59:59.000000000","message":"I thought you were implying I should count the deleted records and then change the logic based on how many were deleted?","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"17274c0a6d43bedccf5ae52ef1e24537e2013870","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        if record:"},{"line_number":93,"context_line":"            context.session.delete(record)"},{"line_number":94,"context_line":"            LOG.debug(\"Provisioning for %(otype)s %(oid)s completed by entity \""},{"line_number":95,"context_line":"                      \"%(entity)s.\", log_dict)"},{"line_number":96,"context_line":"    # now with that committed, check if any records are left. if None, emit"},{"line_number":97,"context_line":"    # an event that provisioning is complete. Note that two threads could"},{"line_number":98,"context_line":"    # reach this conclusion at the same time so subscribers to this callback"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_3aa6b9c1","line":95,"in_reply_to":"1a122d0e_995f290e","updated":"2016-04-15 21:41:02.000000000","message":"Looking only at the code block above, if a driver did not set any provisioning block for \u0027entity\u0027, then deleted op will be a no-op, the query at line 100 will yield no results, and the notification will be sent - thus preserving backward comp.\n\nwhat am I missing?","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"107ce5497e4b9f0395cb38ebf64bbba73c4f2cea","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        if record:"},{"line_number":93,"context_line":"            context.session.delete(record)"},{"line_number":94,"context_line":"            LOG.debug(\"Provisioning for %(otype)s %(oid)s completed by entity \""},{"line_number":95,"context_line":"                      \"%(entity)s.\", log_dict)"},{"line_number":96,"context_line":"    # now with that committed, check if any records are left. if None, emit"},{"line_number":97,"context_line":"    # an event that provisioning is complete. Note that two threads could"},{"line_number":98,"context_line":"    # reach this conclusion at the same time so subscribers to this callback"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_995f290e","line":95,"in_reply_to":"1a122d0e_c820b1fa","updated":"2016-04-15 15:58:09.000000000","message":"It would be, but I was a little concerned there may be cases of external drivers that won\u0027t setup the provisioning block and then when they call update_device_up via the RPC API, nothing would happen.\n\nSo for backward compat, I just figured that this will behave like update_device_up when there are no blocks.","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"df23507d5163d581e43e5783982ae447c2b1ecab","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            LOG.debug(\"Provisioning for %(otype)s %(oid)s completed by entity \""},{"line_number":95,"context_line":"                      \"%(entity)s.\", log_dict)"},{"line_number":96,"context_line":"    # now with that committed, check if any records are left. if None, emit"},{"line_number":97,"context_line":"    # an event that provisioning is complete. Note that two threads could"},{"line_number":98,"context_line":"    # reach this conclusion at the same time so subscribers to this callback"},{"line_number":99,"context_line":"    # should perform idempotent operations"},{"line_number":100,"context_line":"    records \u003d context.session.query(ProvisioningBlock).filter_by("}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_45cacca2","line":97,"updated":"2016-04-15 15:11:21.000000000","message":"two threads, two workers, two processes on different nodes, etc. etc.\n\nmeh","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"107ce5497e4b9f0395cb38ebf64bbba73c4f2cea","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            LOG.debug(\"Provisioning for %(otype)s %(oid)s completed by entity \""},{"line_number":95,"context_line":"                      \"%(entity)s.\", log_dict)"},{"line_number":96,"context_line":"    # now with that committed, check if any records are left. if None, emit"},{"line_number":97,"context_line":"    # an event that provisioning is complete. Note that two threads could"},{"line_number":98,"context_line":"    # reach this conclusion at the same time so subscribers to this callback"},{"line_number":99,"context_line":"    # should perform idempotent operations"},{"line_number":100,"context_line":"    records \u003d context.session.query(ProvisioningBlock).filter_by("}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_f99a9dc4","line":97,"in_reply_to":"1a122d0e_45cacca2","updated":"2016-04-15 15:58:09.000000000","message":"Right","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"5a3b2320c7c8b867805594f15608de8b9c8d5eb8","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from neutron.callbacks import registry"},{"line_number":21,"context_line":"from neutron.db import api as db_api"},{"line_number":22,"context_line":"from neutron.db import model_base"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":"PROVISIONING_COMPLETE \u003d \u0027provisioning_complete\u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_c8ab6888","line":23,"updated":"2016-04-18 06:14:12.000000000","message":"only need one new line here","commit_id":"6cd73cb3b280420ab740f9da7c69dd4e741f0078"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"fc66e0e8926ef38e31ccd7edf5966fe23aab6330","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from neutron.callbacks import registry"},{"line_number":21,"context_line":"from neutron.db import api as db_api"},{"line_number":22,"context_line":"from neutron.db import model_base"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":26,"context_line":"PROVISIONING_COMPLETE \u003d \u0027provisioning_complete\u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_6bbbf3e5","line":23,"in_reply_to":"1a122d0e_c8ab6888","updated":"2016-04-19 09:40:14.000000000","message":"Done","commit_id":"6cd73cb3b280420ab740f9da7c69dd4e741f0078"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"5a3b2320c7c8b867805594f15608de8b9c8d5eb8","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    # this can\u0027t be called in a transaction to avoid REPEATABLE READ"},{"line_number":100,"context_line":"    # tricking us into thinking there are remaining provisioning components"},{"line_number":101,"context_line":"    if context.session.is_active:"},{"line_number":102,"context_line":"        raise RuntimeError(\"Must not be called in a transaction\")"},{"line_number":103,"context_line":"    standard_attr_id \u003d _get_standard_attr_id(context, object_id,"},{"line_number":104,"context_line":"                                             object_type)"},{"line_number":105,"context_line":"    if not standard_attr_id:"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_e892a456","line":102,"updated":"2016-04-18 06:14:12.000000000","message":"missing translation","commit_id":"6cd73cb3b280420ab740f9da7c69dd4e741f0078"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"fc66e0e8926ef38e31ccd7edf5966fe23aab6330","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    # this can\u0027t be called in a transaction to avoid REPEATABLE READ"},{"line_number":100,"context_line":"    # tricking us into thinking there are remaining provisioning components"},{"line_number":101,"context_line":"    if context.session.is_active:"},{"line_number":102,"context_line":"        raise RuntimeError(\"Must not be called in a transaction\")"},{"line_number":103,"context_line":"    standard_attr_id \u003d _get_standard_attr_id(context, object_id,"},{"line_number":104,"context_line":"                                             object_type)"},{"line_number":105,"context_line":"    if not standard_attr_id:"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_93368150","line":102,"in_reply_to":"1a122d0e_e892a456","updated":"2016-04-19 09:40:14.000000000","message":"Done","commit_id":"6cd73cb3b280420ab740f9da7c69dd4e741f0078"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":29,"context_line":"L2_AGENT_ENTITY \u003d \u0027L2 Agent\u0027"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class ProvisioningBlock(model_base.BASEV2):"},{"line_number":33,"context_line":"    # the standard attr id of the thing we want to block"},{"line_number":34,"context_line":"    standard_attr_id \u003d ("},{"line_number":35,"context_line":"        sa.Column(sa.BigInteger().with_variant(sa.Integer(), \u0027sqlite\u0027),"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_e4dfba0a","line":32,"updated":"2016-04-21 07:03:33.000000000","message":"Because the provisioning block itself doesn\u0027t have standard attributes (e.g. tags, description, timestamp, etc).","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":29,"context_line":"L2_AGENT_ENTITY \u003d \u0027L2 Agent\u0027"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class ProvisioningBlock(model_base.BASEV2):"},{"line_number":33,"context_line":"    # the standard attr id of the thing we want to block"},{"line_number":34,"context_line":"    standard_attr_id \u003d ("},{"line_number":35,"context_line":"        sa.Column(sa.BigInteger().with_variant(sa.Integer(), \u0027sqlite\u0027),"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_513daadb","line":32,"updated":"2016-04-20 17:35:13.000000000","message":"why not use the mixin model_base.HasStandardAttributes?","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def _get_standard_attr_id(context, object_id, object_type):"},{"line_number":46,"context_line":"    # NOTE(kevinbenton): this is hacky because it assumes the table name"},{"line_number":47,"context_line":"    # is the plural form of the callback topic. We can allow explicit"},{"line_number":48,"context_line":"    # table names as an optional argument in the future if necessary."},{"line_number":49,"context_line":"    table \u003d \u0027%ss\u0027 % object_type"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_c4e27ed4","line":46,"updated":"2016-04-21 07:03:33.000000000","message":"Sure, should that live in the registry? This is to translate registry types to table.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"def _get_standard_attr_id(context, object_id, object_type):"},{"line_number":46,"context_line":"    # NOTE(kevinbenton): this is hacky because it assumes the table name"},{"line_number":47,"context_line":"    # is the plural form of the callback topic. We can allow explicit"},{"line_number":48,"context_line":"    # table names as an optional argument in the future if necessary."},{"line_number":49,"context_line":"    table \u003d \u0027%ss\u0027 % object_type"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_ac166549","line":46,"updated":"2016-04-20 17:35:13.000000000","message":"what if you had a lookup table (type-\u003etable)? That would solve the hacky problemo","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":49,"context_line":"    table \u003d \u0027%ss\u0027 % object_type"},{"line_number":50,"context_line":"    model \u003d model_base.BASEV2.metadata.tables.get(table)"},{"line_number":51,"context_line":"    if model is None:"},{"line_number":52,"context_line":"        raise RuntimeError(_LE(\"Could not find table for %s\") % object_type)"},{"line_number":53,"context_line":"    # TODO(kevinbenton): ML2 allows partial port IDs so we have to use"},{"line_number":54,"context_line":"    # \u0027startswith\u0027 to find the object. We should consider having that"},{"line_number":55,"context_line":"    # converted to a ID immediately so no other methods have to use"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_2c50950a","line":52,"updated":"2016-04-20 17:35:13.000000000","message":"this is clearly a bug induced by a typo of some sort, I suppose we could avoid raising it if we had a guarantee of good test coverage. So I\u0027d remove it in favor of being more strict during code review.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    model \u003d model_base.BASEV2.metadata.tables.get(table)"},{"line_number":51,"context_line":"    if model is None:"},{"line_number":52,"context_line":"        raise RuntimeError(_LE(\"Could not find table for %s\") % object_type)"},{"line_number":53,"context_line":"    # TODO(kevinbenton): ML2 allows partial port IDs so we have to use"},{"line_number":54,"context_line":"    # \u0027startswith\u0027 to find the object. We should consider having that"},{"line_number":55,"context_line":"    # converted to a ID immediately so no other methods have to use"},{"line_number":56,"context_line":"    # \u0027startswith\u0027 lookups."}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_d7b36a4b","line":53,"updated":"2016-04-20 17:35:13.000000000","message":"Btw I see that add_provisioning_component is used by both the plugin and the mech driver. Which one is responsible for the partial port ID? I am not quite clear.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    model \u003d model_base.BASEV2.metadata.tables.get(table)"},{"line_number":51,"context_line":"    if model is None:"},{"line_number":52,"context_line":"        raise RuntimeError(_LE(\"Could not find table for %s\") % object_type)"},{"line_number":53,"context_line":"    # TODO(kevinbenton): ML2 allows partial port IDs so we have to use"},{"line_number":54,"context_line":"    # \u0027startswith\u0027 to find the object. We should consider having that"},{"line_number":55,"context_line":"    # converted to a ID immediately so no other methods have to use"},{"line_number":56,"context_line":"    # \u0027startswith\u0027 lookups."}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_24e6d2e7","line":53,"updated":"2016-04-21 07:03:33.000000000","message":"The partial ID happens when it comes time to actually lift the provisioning block from the L2 agent. When the Linux Bridge agent calls update_device_up, all it knows is the interface name (e.g. tap123455873). So update_device_up strips off the leading \u0027tap\u0027 and passes that into all of the DB stuff as the port ID.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    # \u0027startswith\u0027 to find the object. We should consider having that"},{"line_number":55,"context_line":"    # converted to a ID immediately so no other methods have to use"},{"line_number":56,"context_line":"    # \u0027startswith\u0027 lookups."},{"line_number":57,"context_line":"    obj \u003d (context.session.query(model).enable_eagerloads(False)."},{"line_number":58,"context_line":"           filter(model.c.id.startswith(object_id)).first())"},{"line_number":59,"context_line":"    if not obj:"},{"line_number":60,"context_line":"        # concurrent delete"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_04e916b7","line":57,"updated":"2016-04-21 07:03:33.000000000","message":"Yes, now that I\u0027m thinking about it this is very specific to update_device_up allowing short IDs so this should be fixed up there.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    # \u0027startswith\u0027 to find the object. We should consider having that"},{"line_number":55,"context_line":"    # converted to a ID immediately so no other methods have to use"},{"line_number":56,"context_line":"    # \u0027startswith\u0027 lookups."},{"line_number":57,"context_line":"    obj \u003d (context.session.query(model).enable_eagerloads(False)."},{"line_number":58,"context_line":"           filter(model.c.id.startswith(object_id)).first())"},{"line_number":59,"context_line":"    if not obj:"},{"line_number":60,"context_line":"        # concurrent delete"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_57b2bae5","line":57,"updated":"2016-04-20 17:35:13.000000000","message":"if this is ML2 specific would it make sense to move it to the ml2/db module? Not quite sure I fully grasp the extent of this note. We should perhaps extract the _get_standard_attr_id from add_provisioning_component and make the latter handle only \u0027full\u0027 object_id to accommodate non ML2 implementations.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":104,"context_line":"    # this can\u0027t be called in a transaction to avoid REPEATABLE READ"},{"line_number":105,"context_line":"    # tricking us into thinking there are remaining provisioning components"},{"line_number":106,"context_line":"    if context.session.is_active:"},{"line_number":107,"context_line":"        raise RuntimeError(\"Must not be called in a transaction\")"},{"line_number":108,"context_line":"    standard_attr_id \u003d _get_standard_attr_id(context, object_id,"},{"line_number":109,"context_line":"                                             object_type)"},{"line_number":110,"context_line":"    if not standard_attr_id:"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_64d44aeb","line":107,"updated":"2016-04-21 07:03:33.000000000","message":"Aye","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":104,"context_line":"    # this can\u0027t be called in a transaction to avoid REPEATABLE READ"},{"line_number":105,"context_line":"    # tricking us into thinking there are remaining provisioning components"},{"line_number":106,"context_line":"    if context.session.is_active:"},{"line_number":107,"context_line":"        raise RuntimeError(\"Must not be called in a transaction\")"},{"line_number":108,"context_line":"    standard_attr_id \u003d _get_standard_attr_id(context, object_id,"},{"line_number":109,"context_line":"                                             object_type)"},{"line_number":110,"context_line":"    if not standard_attr_id:"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_37f1fe6b","line":107,"updated":"2016-04-20 17:35:13.000000000","message":"_LE?","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5469f01a3bb7a73df5d7487f597ab719270922e2","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    _RESOURCE_TO_MODEL_MAP[resource] \u003d model"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"def _get_standard_attr_id(context, object_id, object_type):"},{"line_number":51,"context_line":"    model \u003d _RESOURCE_TO_MODEL_MAP.get(object_type)"},{"line_number":52,"context_line":"    if not model:"},{"line_number":53,"context_line":"        raise RuntimeError(_LE(\"Could not find model for %s. If you are \""}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_279177f1","line":50,"updated":"2016-05-07 00:52:43.000000000","message":"I tend to stick privates with privates, public with public, so this should go to the bottom of the module, meh meh","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"806b678860ca2994beae82f3f0069d77ef09de56","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    _RESOURCE_TO_MODEL_MAP[resource] \u003d model"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"def _get_standard_attr_id(context, object_id, object_type):"},{"line_number":51,"context_line":"    model \u003d _RESOURCE_TO_MODEL_MAP.get(object_type)"},{"line_number":52,"context_line":"    if not model:"},{"line_number":53,"context_line":"        raise RuntimeError(_LE(\"Could not find model for %s. If you are \""}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_056af0ed","line":50,"updated":"2016-05-10 21:28:07.000000000","message":"If that\u0027s how you feel.","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5469f01a3bb7a73df5d7487f597ab719270922e2","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    return obj.standard_attr_id"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def add_provisioning_component(context, object_id, object_type, entity):"},{"line_number":67,"context_line":"    log_dict \u003d {\u0027entity\u0027: entity, \u0027oid\u0027: object_id, \u0027otype\u0027: object_type}"},{"line_number":68,"context_line":"    # we get an object\u0027s ID, so we need to convert that into a standard attr id"},{"line_number":69,"context_line":"    standard_attr_id \u003d _get_standard_attr_id(context, object_id, object_type)"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_e7864fb8","line":66,"updated":"2016-05-07 00:52:43.000000000","message":"docstring plz, enumerating what parameters to expect?","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"806b678860ca2994beae82f3f0069d77ef09de56","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    return obj.standard_attr_id"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def add_provisioning_component(context, object_id, object_type, entity):"},{"line_number":67,"context_line":"    log_dict \u003d {\u0027entity\u0027: entity, \u0027oid\u0027: object_id, \u0027otype\u0027: object_type}"},{"line_number":68,"context_line":"    # we get an object\u0027s ID, so we need to convert that into a standard attr id"},{"line_number":69,"context_line":"    standard_attr_id \u003d _get_standard_attr_id(context, object_id, object_type)"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_656bfcf1","line":66,"updated":"2016-05-10 21:28:07.000000000","message":"maybe","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5469f01a3bb7a73df5d7487f597ab719270922e2","unresolved":false,"context_lines":[{"line_number":84,"context_line":"              log_dict)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"def clear_provisioning_component(context, object_id, object_type, entity,"},{"line_number":88,"context_line":"                                 standard_attr_id\u003dNone):"},{"line_number":89,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":90,"context_line":"        standard_attr_id \u003d standard_attr_id or _get_standard_attr_id("}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_c79fcb01","line":87,"updated":"2016-05-07 00:52:43.000000000","message":"docstring plz, enumerating what parameters to expect?","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"806b678860ca2994beae82f3f0069d77ef09de56","unresolved":false,"context_lines":[{"line_number":84,"context_line":"              log_dict)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"def clear_provisioning_component(context, object_id, object_type, entity,"},{"line_number":88,"context_line":"                                 standard_attr_id\u003dNone):"},{"line_number":89,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":90,"context_line":"        standard_attr_id \u003d standard_attr_id or _get_standard_attr_id("}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_457078dc","line":87,"updated":"2016-05-10 21:28:07.000000000","message":"maybe","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5469f01a3bb7a73df5d7487f597ab719270922e2","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return False"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def provisioning_complete(context, object_id, object_type, entity):"},{"line_number":103,"context_line":"    log_dict \u003d {\u0027oid\u0027: object_id, \u0027entity\u0027: entity, \u0027otype\u0027: object_type}"},{"line_number":104,"context_line":"    # this can\u0027t be called in a transaction to avoid REPEATABLE READ"},{"line_number":105,"context_line":"    # tricking us into thinking there are remaining provisioning components"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_67f37f74","line":102,"updated":"2016-05-07 00:52:43.000000000","message":"docstring plz, enumerating what parameters you expect?","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"806b678860ca2994beae82f3f0069d77ef09de56","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        return False"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def provisioning_complete(context, object_id, object_type, entity):"},{"line_number":103,"context_line":"    log_dict \u003d {\u0027oid\u0027: object_id, \u0027entity\u0027: entity, \u0027otype\u0027: object_type}"},{"line_number":104,"context_line":"    # this can\u0027t be called in a transaction to avoid REPEATABLE READ"},{"line_number":105,"context_line":"    # tricking us into thinking there are remaining provisioning components"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_a57964ca","line":102,"updated":"2016-05-10 21:28:07.000000000","message":"maybe","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5469f01a3bb7a73df5d7487f597ab719270922e2","unresolved":false,"context_lines":[{"line_number":102,"context_line":"def provisioning_complete(context, object_id, object_type, entity):"},{"line_number":103,"context_line":"    log_dict \u003d {\u0027oid\u0027: object_id, \u0027entity\u0027: entity, \u0027otype\u0027: object_type}"},{"line_number":104,"context_line":"    # this can\u0027t be called in a transaction to avoid REPEATABLE READ"},{"line_number":105,"context_line":"    # tricking us into thinking there are remaining provisioning components"},{"line_number":106,"context_line":"    if context.session.is_active:"},{"line_number":107,"context_line":"        raise RuntimeError(_LE(\"Must not be called in a transaction\"))"},{"line_number":108,"context_line":"    standard_attr_id \u003d _get_standard_attr_id(context, object_id,"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_27fa1743","line":105,"updated":"2016-05-07 00:52:43.000000000","message":"could you not use your fancy transaction_guard decorator?","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"806b678860ca2994beae82f3f0069d77ef09de56","unresolved":false,"context_lines":[{"line_number":102,"context_line":"def provisioning_complete(context, object_id, object_type, entity):"},{"line_number":103,"context_line":"    log_dict \u003d {\u0027oid\u0027: object_id, \u0027entity\u0027: entity, \u0027otype\u0027: object_type}"},{"line_number":104,"context_line":"    # this can\u0027t be called in a transaction to avoid REPEATABLE READ"},{"line_number":105,"context_line":"    # tricking us into thinking there are remaining provisioning components"},{"line_number":106,"context_line":"    if context.session.is_active:"},{"line_number":107,"context_line":"        raise RuntimeError(_LE(\"Must not be called in a transaction\"))"},{"line_number":108,"context_line":"    standard_attr_id \u003d _get_standard_attr_id(context, object_id,"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_8576e0d4","line":105,"updated":"2016-05-10 21:28:07.000000000","message":"no, it only works with a bound method because context must be the second argument.","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"980db82a46f41c6dfdae3d61b4c0a401ec982db4","unresolved":false,"context_lines":[{"line_number":28,"context_line":"PROVISIONING_COMPLETE \u003d \u0027provisioning_complete\u0027"},{"line_number":29,"context_line":"# identifiers for the various entities that participate in provisioning"},{"line_number":30,"context_line":"DHCP_ENTITY \u003d \u0027DHCP\u0027"},{"line_number":31,"context_line":"L2_AGENT_ENTITY \u003d \u0027L2 Agent\u0027"},{"line_number":32,"context_line":"_RESOURCE_TO_MODEL_MAP \u003d {resources.PORT: models_v2.Port}"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"dab17558_875ab128","line":31,"updated":"2016-05-13 22:57:41.000000000","message":"meh, I\u0027d have called this L2, meh","commit_id":"98b1588fab09799bb1dca3dfe97c2d6b62a41f96"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e26a2f02030b8ec43a36c6c68f0ce73c462ee7ef","unresolved":false,"context_lines":[{"line_number":28,"context_line":"PROVISIONING_COMPLETE \u003d \u0027provisioning_complete\u0027"},{"line_number":29,"context_line":"# identifiers for the various entities that participate in provisioning"},{"line_number":30,"context_line":"DHCP_ENTITY \u003d \u0027DHCP\u0027"},{"line_number":31,"context_line":"L2_AGENT_ENTITY \u003d \u0027L2 Agent\u0027"},{"line_number":32,"context_line":"_RESOURCE_TO_MODEL_MAP \u003d {resources.PORT: models_v2.Port}"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"dab17558_fedcc8e5","line":31,"in_reply_to":"dab17558_875ab128","updated":"2016-05-16 08:26:58.000000000","message":"I\u0027ll do it!","commit_id":"98b1588fab09799bb1dca3dfe97c2d6b62a41f96"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"980db82a46f41c6dfdae3d61b4c0a401ec982db4","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                                       entity\u003dentity)"},{"line_number":75,"context_line":"            context.session.add(record)"},{"line_number":76,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":77,"context_line":"        # an entry could be leftover from a previous transition."},{"line_number":78,"context_line":"        LOG.debug(\"Ignored duplicate provisioning block setup for %(otype)s \""},{"line_number":79,"context_line":"                  \"%(oid)s by entity %(entity)s.\", log_dict)"},{"line_number":80,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":26,"id":"dab17558_679b4dca","line":77,"updated":"2016-05-13 22:57:41.000000000","message":"or can it be an example of multiple replicas/calls potentially interleaving?","commit_id":"98b1588fab09799bb1dca3dfe97c2d6b62a41f96"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e26a2f02030b8ec43a36c6c68f0ce73c462ee7ef","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                                       entity\u003dentity)"},{"line_number":75,"context_line":"            context.session.add(record)"},{"line_number":76,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":77,"context_line":"        # an entry could be leftover from a previous transition."},{"line_number":78,"context_line":"        LOG.debug(\"Ignored duplicate provisioning block setup for %(otype)s \""},{"line_number":79,"context_line":"                  \"%(oid)s by entity %(entity)s.\", log_dict)"},{"line_number":80,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":26,"id":"dab17558_be9c000f","line":77,"in_reply_to":"dab17558_679b4dca","updated":"2016-05-16 08:26:58.000000000","message":"Yeah, that\u0027s effectively the same thing. I\u0027ll clarify.","commit_id":"98b1588fab09799bb1dca3dfe97c2d6b62a41f96"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"980db82a46f41c6dfdae3d61b4c0a401ec982db4","unresolved":false,"context_lines":[{"line_number":83,"context_line":"              log_dict)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"def clear_provisioning_component(context, object_id, object_type, entity,"},{"line_number":87,"context_line":"                                 standard_attr_id\u003dNone):"},{"line_number":88,"context_line":"    \"\"\"Removes a provisioning block for an object with triggering a callback."},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"dab17558_67d06d54","line":86,"updated":"2016-05-13 22:57:41.000000000","message":"I would have said: \n\ndef remove_provisioning_component but meh","commit_id":"98b1588fab09799bb1dca3dfe97c2d6b62a41f96"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e26a2f02030b8ec43a36c6c68f0ce73c462ee7ef","unresolved":false,"context_lines":[{"line_number":83,"context_line":"              log_dict)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"def clear_provisioning_component(context, object_id, object_type, entity,"},{"line_number":87,"context_line":"                                 standard_attr_id\u003dNone):"},{"line_number":88,"context_line":"    \"\"\"Removes a provisioning block for an object with triggering a callback."},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"dab17558_fe8a08be","line":86,"in_reply_to":"dab17558_67d06d54","updated":"2016-05-16 08:26:58.000000000","message":"sure, anything for you","commit_id":"98b1588fab09799bb1dca3dfe97c2d6b62a41f96"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"980db82a46f41c6dfdae3d61b4c0a401ec982db4","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    Marks that an entity has finished provisioning an object. If there are"},{"line_number":120,"context_line":"    no remaining provisioning components, a callback will be triggered"},{"line_number":121,"context_line":"    indicating that provisioning has been completed for the object. Subscribers"},{"line_number":122,"context_line":"    to this callback should be idempotent because it may be called multiple"},{"line_number":123,"context_line":"    times in high availability deployments."},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    :param context: neutron api request context"}],"source_content_type":"text/x-python","patch_set":26,"id":"dab17558_e7dd7d71","line":122,"updated":"2016-05-13 22:57:41.000000000","message":"should -\u003e must, but meh","commit_id":"98b1588fab09799bb1dca3dfe97c2d6b62a41f96"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e26a2f02030b8ec43a36c6c68f0ce73c462ee7ef","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    Marks that an entity has finished provisioning an object. If there are"},{"line_number":120,"context_line":"    no remaining provisioning components, a callback will be triggered"},{"line_number":121,"context_line":"    indicating that provisioning has been completed for the object. Subscribers"},{"line_number":122,"context_line":"    to this callback should be idempotent because it may be called multiple"},{"line_number":123,"context_line":"    times in high availability deployments."},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    :param context: neutron api request context"}],"source_content_type":"text/x-python","patch_set":26,"id":"dab17558_de8744b3","line":122,"in_reply_to":"dab17558_e7dd7d71","updated":"2016-05-16 08:26:58.000000000","message":"Done","commit_id":"98b1588fab09799bb1dca3dfe97c2d6b62a41f96"}],"neutron/db/status_barriers.py":[{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"3f21076266f652bff1c37a2738b22e5f3dff7e42","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    # the entity that wants to block the status change"},{"line_number":32,"context_line":"    entity \u003d sa.Column(sa.String(32), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":33,"context_line":"    # the status that the entity wants to prevent (e.g. ACTIVE)"},{"line_number":34,"context_line":"    status \u003d sa.Column(sa.String(32), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":35,"context_line":"    # object type is used to determine which callback topic to use"},{"line_number":36,"context_line":"    object_type \u003d sa.Column(sa.String(36))"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa1b9901_74dea140","line":34,"updated":"2015-08-19 09:25:11.000000000","message":"The barrier could be a bit more generic if a transition could be blocked, not a state (eg. you could block BUILD-\u003eACTIVE, instead of blocking ACTIVE). On the other I don\u0027t know if there\u0027s any need for this.","commit_id":"9cf469e9729e0bba855e2b119f32a8c59b433471"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"70d8b246798d6079058730d57124ecc8508bfde6","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    # the entity that wants to block the status change"},{"line_number":32,"context_line":"    entity \u003d sa.Column(sa.String(32), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":33,"context_line":"    # the status that the entity wants to prevent (e.g. ACTIVE)"},{"line_number":34,"context_line":"    status \u003d sa.Column(sa.String(32), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":35,"context_line":"    # object type is used to determine which callback topic to use"},{"line_number":36,"context_line":"    object_type \u003d sa.Column(sa.String(36))"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa1b9901_53afc5e1","line":34,"in_reply_to":"fa1b9901_74dea140","updated":"2015-08-20 01:38:08.000000000","message":"In this particular case I don\u0027t think we want to limit to BUILD-\u003eACTIVE. I want any change to ACTIVE.","commit_id":"9cf469e9729e0bba855e2b119f32a8c59b433471"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"3f21076266f652bff1c37a2738b22e5f3dff7e42","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        record \u003d StatusBarrier(object_id\u003dobject_id, entity\u003dentity,"},{"line_number":42,"context_line":"                               status\u003dstatus, object_type\u003dobject_type)"},{"line_number":43,"context_line":"        context.session.add(record)"},{"line_number":44,"context_line":"    LOG.debug(\"Transition to status %(status)s for %(otype)s object %(oid)s \""},{"line_number":45,"context_line":"              \"will not be allowed until cleared by entity %(entity)s.\","},{"line_number":46,"context_line":"              {\u0027status\u0027: status, \u0027entity\u0027: entity, \u0027oid\u0027: object_id,"},{"line_number":47,"context_line":"               \u0027otype\u0027: object_type})"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa1b9901_4f1d060e","line":44,"updated":"2015-08-19 09:25:11.000000000","message":"Maybe LOG.info would be better.\n\nAs I see for an admin these log lines are the only usable interface to understand why a state transition never happened (when it never happens). And they can\u0027t raise the log level to debug after the fact.","commit_id":"9cf469e9729e0bba855e2b119f32a8c59b433471"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"70d8b246798d6079058730d57124ecc8508bfde6","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        record \u003d StatusBarrier(object_id\u003dobject_id, entity\u003dentity,"},{"line_number":42,"context_line":"                               status\u003dstatus, object_type\u003dobject_type)"},{"line_number":43,"context_line":"        context.session.add(record)"},{"line_number":44,"context_line":"    LOG.debug(\"Transition to status %(status)s for %(otype)s object %(oid)s \""},{"line_number":45,"context_line":"              \"will not be allowed until cleared by entity %(entity)s.\","},{"line_number":46,"context_line":"              {\u0027status\u0027: status, \u0027entity\u0027: entity, \u0027oid\u0027: object_id,"},{"line_number":47,"context_line":"               \u0027otype\u0027: object_type})"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa1b9901_336b31b9","line":44,"in_reply_to":"fa1b9901_4f1d060e","updated":"2015-08-20 01:38:08.000000000","message":"This particular line will show up multiple times per port. I don\u0027t know if we want that at the info log level. Let me think of a way to log when a port isn\u0027t being allowed for an abnormal amount of time.","commit_id":"9cf469e9729e0bba855e2b119f32a8c59b433471"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"271ac80ca81ab3381267782c3f8cbf5aed38a5dc","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":"STATUS_BARRIER_SATISFIED \u003d \u0027status_barrier_satisfied\u0027"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"class StatusBarrier(model_base.BASEV2):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_c8d6d4f0","line":25,"updated":"2015-09-16 15:01:10.000000000","message":"Shouldn\u0027t it be moved to events.py?","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":"STATUS_BARRIER_SATISFIED \u003d \u0027status_barrier_satisfied\u0027"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"class StatusBarrier(model_base.BASEV2):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_e8e5e308","line":25,"in_reply_to":"ba15a1d1_c8d6d4f0","updated":"2015-09-23 01:23:57.000000000","message":"Armando has informed me that it\u0027s not worthy of being there.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1247dbe7ce033f50d62f5cddc5d716bbeb136148","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    object_type \u003d sa.Column(sa.String(36))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def add_object_status_barrier(context, entity, object_id, object_type, status):"},{"line_number":40,"context_line":"    try:"},{"line_number":41,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":42,"context_line":"            record \u003d StatusBarrier(object_id\u003dobject_id, entity\u003dentity,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_fce13a9b","line":39,"updated":"2015-09-16 15:58:20.000000000","message":"nit:  consistency in the order of these values may help readability.  Above, in the StatusBarrier class the order is object_id, entity, status, object_type.  It actually confused me a little when I read the callers of this method having seen the StatusBarrier class above since I had that order already in mind.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    object_type \u003d sa.Column(sa.String(36))"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def add_object_status_barrier(context, entity, object_id, object_type, status):"},{"line_number":40,"context_line":"    try:"},{"line_number":41,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":42,"context_line":"            record \u003d StatusBarrier(object_id\u003dobject_id, entity\u003dentity,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_68c0f350","line":39,"in_reply_to":"ba15a1d1_fce13a9b","updated":"2015-09-23 01:23:57.000000000","message":"Done","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1247dbe7ce033f50d62f5cddc5d716bbeb136148","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            StatusBarrier.object_id \u003d\u003d object_id)"},{"line_number":58,"context_line":"        if status:"},{"line_number":59,"context_line":"            entities \u003d entities.filter(StatusBarrier.status \u003d\u003d status)"},{"line_number":60,"context_line":"        entities \u003d entities.all()"},{"line_number":61,"context_line":"        for e in entities:"},{"line_number":62,"context_line":"            context.session.delete(e)"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_dc9476e3","line":60,"updated":"2015-09-16 15:58:20.000000000","message":"Why not call .delete() directly?","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            StatusBarrier.object_id \u003d\u003d object_id)"},{"line_number":58,"context_line":"        if status:"},{"line_number":59,"context_line":"            entities \u003d entities.filter(StatusBarrier.status \u003d\u003d status)"},{"line_number":60,"context_line":"        entities \u003d entities.all()"},{"line_number":61,"context_line":"        for e in entities:"},{"line_number":62,"context_line":"            context.session.delete(e)"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_882c67ad","line":60,"in_reply_to":"ba15a1d1_dc9476e3","updated":"2015-09-23 01:23:57.000000000","message":"Done","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"39a2cb2a8f64d623e18728a7f1d795265d316477","unresolved":false,"context_lines":[{"line_number":65,"context_line":"def satisfy_object_status_barrier(context, entity, object_type,"},{"line_number":66,"context_line":"                                  object_id, status):"},{"line_number":67,"context_line":"    fully_satisfied \u003d False"},{"line_number":68,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":69,"context_line":"        records \u003d context.session.query(StatusBarrier).filter("},{"line_number":70,"context_line":"            StatusBarrier.object_id \u003d\u003d object_id).filter("},{"line_number":71,"context_line":"            StatusBarrier.status \u003d\u003d status).all()"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_8a825493","line":68,"updated":"2015-09-15 09:33:32.000000000","message":"consider using db_api.autonested_transactions\n\nThis will make your code safer if this method is run within a transaction - unless you explicit want a failure in this transaction to rollback the outer trx","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":65,"context_line":"def satisfy_object_status_barrier(context, entity, object_type,"},{"line_number":66,"context_line":"                                  object_id, status):"},{"line_number":67,"context_line":"    fully_satisfied \u003d False"},{"line_number":68,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":69,"context_line":"        records \u003d context.session.query(StatusBarrier).filter("},{"line_number":70,"context_line":"            StatusBarrier.object_id \u003d\u003d object_id).filter("},{"line_number":71,"context_line":"            StatusBarrier.status \u003d\u003d status).all()"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_c80d7f3f","line":68,"in_reply_to":"ba15a1d1_8a825493","updated":"2015-09-23 01:23:57.000000000","message":"right now it\u0027s not called within a transaction in the two use cases but I can do that to be defensive for future ones.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"39a2cb2a8f64d623e18728a7f1d795265d316477","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":69,"context_line":"        records \u003d context.session.query(StatusBarrier).filter("},{"line_number":70,"context_line":"            StatusBarrier.object_id \u003d\u003d object_id).filter("},{"line_number":71,"context_line":"            StatusBarrier.status \u003d\u003d status).all()"},{"line_number":72,"context_line":"        if not records:"},{"line_number":73,"context_line":"            # there are no barriers on this object. This shouldn\u0027t happen"},{"line_number":74,"context_line":"            # unless there is a race where the clearance happens before the"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_6a99001f","line":71,"updated":"2015-09-15 09:33:32.000000000","message":"do you really need the call to all()?","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":69,"context_line":"        records \u003d context.session.query(StatusBarrier).filter("},{"line_number":70,"context_line":"            StatusBarrier.object_id \u003d\u003d object_id).filter("},{"line_number":71,"context_line":"            StatusBarrier.status \u003d\u003d status).all()"},{"line_number":72,"context_line":"        if not records:"},{"line_number":73,"context_line":"            # there are no barriers on this object. This shouldn\u0027t happen"},{"line_number":74,"context_line":"            # unless there is a race where the clearance happens before the"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_eb94fd8b","line":71,"in_reply_to":"ba15a1d1_6a99001f","updated":"2015-09-23 01:23:57.000000000","message":"not anymore","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"647ed157ed31587132518587ee4adfb35c7e199a","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":69,"context_line":"        records \u003d context.session.query(StatusBarrier).filter("},{"line_number":70,"context_line":"            StatusBarrier.object_id \u003d\u003d object_id).filter("},{"line_number":71,"context_line":"            StatusBarrier.status \u003d\u003d status).all()"},{"line_number":72,"context_line":"        if not records:"},{"line_number":73,"context_line":"            # there are no barriers on this object. This shouldn\u0027t happen"},{"line_number":74,"context_line":"            # unless there is a race where the clearance happens before the"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_6b7f8de0","line":71,"in_reply_to":"ba15a1d1_6a99001f","updated":"2015-09-23 01:41:28.000000000","message":"sorry, yes. need to check how many records there are to see if the matching one is the last one.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"39a2cb2a8f64d623e18728a7f1d795265d316477","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        if not records:"},{"line_number":73,"context_line":"            # there are no barriers on this object. This shouldn\u0027t happen"},{"line_number":74,"context_line":"            # unless there is a race where the clearance happens before the"},{"line_number":75,"context_line":"            # barrier is added."},{"line_number":76,"context_line":"            LOG.debug(\"%(entity)s cleared a status barrier on %(otype)s \""},{"line_number":77,"context_line":"                      \"%(oid)s which had no barriers for status %(status)s.\","},{"line_number":78,"context_line":"                      {\u0027entity\u0027: entity, \u0027otype\u0027: object_type,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_aa2b9893","line":75,"updated":"2015-09-15 09:33:32.000000000","message":"This could happen actually also if the barrier if lifted twice. With multiple workers - or multiple distinct server behing a loadbalancer - there\u0027s always a change this could happen","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1247dbe7ce033f50d62f5cddc5d716bbeb136148","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        if not records:"},{"line_number":73,"context_line":"            # there are no barriers on this object. This shouldn\u0027t happen"},{"line_number":74,"context_line":"            # unless there is a race where the clearance happens before the"},{"line_number":75,"context_line":"            # barrier is added."},{"line_number":76,"context_line":"            LOG.debug(\"%(entity)s cleared a status barrier on %(otype)s \""},{"line_number":77,"context_line":"                      \"%(oid)s which had no barriers for status %(status)s.\","},{"line_number":78,"context_line":"                      {\u0027entity\u0027: entity, \u0027otype\u0027: object_type,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_b7619b3b","line":75,"in_reply_to":"ba15a1d1_aa2b9893","updated":"2015-09-16 15:58:20.000000000","message":"Thinking out loud...  Would the agent send the status update twice for some reason?  I can\u0027t imagine why.  Even in a load balancer or multiple worker scenario, only one worker should get the message.  I guess even if it happens calling it satisfied is the right thing to do.\n\nThere is another possibility that could lead to this:  first agent sets active to satisfy its barrier before the second barrier is even set.  Could that happen?  It seems this could be avoided by ensuring that all barriers are set before any work is done which could satisfy any of them.  In this case, assuming that all barriers are satisfied seems to be the wrong thing to do.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        if not records:"},{"line_number":73,"context_line":"            # there are no barriers on this object. This shouldn\u0027t happen"},{"line_number":74,"context_line":"            # unless there is a race where the clearance happens before the"},{"line_number":75,"context_line":"            # barrier is added."},{"line_number":76,"context_line":"            LOG.debug(\"%(entity)s cleared a status barrier on %(otype)s \""},{"line_number":77,"context_line":"                      \"%(oid)s which had no barriers for status %(status)s.\","},{"line_number":78,"context_line":"                      {\u0027entity\u0027: entity, \u0027otype\u0027: object_type,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_2b7e756a","line":75,"in_reply_to":"ba15a1d1_b7619b3b","updated":"2015-09-23 01:23:57.000000000","message":"Right, I think the correct thing to is to just return in this case. Multiple DHCP agents per network would end up hitting this a lot because all of them will notify and only the first one will remove a record and that should be the only one that notifies.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"363a87c44a9bf46c7d081e8caa8f6a7adad12154","unresolved":false,"context_lines":[{"line_number":75,"context_line":"            StatusBarrier.status \u003d\u003d status).all()"},{"line_number":76,"context_line":"        for record in records:"},{"line_number":77,"context_line":"            if record.entity \u003d\u003d entity:"},{"line_number":78,"context_line":"                if len(records) \u003d\u003d 1:"},{"line_number":79,"context_line":"                    # this was the last record"},{"line_number":80,"context_line":"                    fully_satisfied \u003d True"},{"line_number":81,"context_line":"                    msg \u003d \u0027All barriers satisfied.\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba15a1d1_171dce61","line":78,"updated":"2015-09-23 05:49:56.000000000","message":"Seems like a possible race condition here:\n\nwhat if, we have two records:\n\n1) two \"satisfy\" arrive in parallel to from rpc worker calls.\n\n2) both delete the entry, but len(records)\u003d\u003d2\n\n3) they do not notify the callback.","commit_id":"1c12023174c34f976e23b3687f2180fe0760c4d3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"7c15ae787e4e700e211838287889c9cf3234aa25","unresolved":false,"context_lines":[{"line_number":75,"context_line":"            StatusBarrier.status \u003d\u003d status).all()"},{"line_number":76,"context_line":"        for record in records:"},{"line_number":77,"context_line":"            if record.entity \u003d\u003d entity:"},{"line_number":78,"context_line":"                if len(records) \u003d\u003d 1:"},{"line_number":79,"context_line":"                    # this was the last record"},{"line_number":80,"context_line":"                    fully_satisfied \u003d True"},{"line_number":81,"context_line":"                    msg \u003d \u0027All barriers satisfied.\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba15a1d1_377012a4","line":78,"in_reply_to":"ba15a1d1_171dce61","updated":"2015-09-23 06:43:58.000000000","message":"good point. looks like we will need a lock on this","commit_id":"1c12023174c34f976e23b3687f2180fe0760c4d3"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ee6608a104d5bdc600e3e0cb7ed3be4c8e33984a","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    # the status that the entity wants to prevent (e.g. ACTIVE)"},{"line_number":38,"context_line":"    status \u003d sa.Column(sa.String(32), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":39,"context_line":"    # the entity that wants to block the status change (e.g. L2 Agent)"},{"line_number":40,"context_line":"    entity \u003d sa.Column(sa.String(32), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def add_object_status_barrier(context, object_id, object_type, status, entity):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_b4d8951f","line":40,"updated":"2015-09-23 11:29:09.000000000","message":"I think you need an expiration for the barrier. the concept might be similar to the quota reservation: if a component goes down while barriers are active you might need a mechanism to invalidate those barriers upon system restart.\n\nThis unless barriers are idempotents - meaning that they would be clared anyway when the affected component(s) restart. For instance this might be the case if the L2 agent only goes down.\n\nBut if the neutron server goes down I really don\u0027t know how safe that would be, since the barriers would be in place but the notification from the agent to remove it will be lost - either an expiration mechanism, or an explicit mechanism to verify active barriers upon restart, might address this.","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2ae57329a1fab139afd3bcd8ac99af312c760a7e","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    # the status that the entity wants to prevent (e.g. ACTIVE)"},{"line_number":38,"context_line":"    status \u003d sa.Column(sa.String(32), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":39,"context_line":"    # the entity that wants to block the status change (e.g. L2 Agent)"},{"line_number":40,"context_line":"    entity \u003d sa.Column(sa.String(32), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def add_object_status_barrier(context, object_id, object_type, status, entity):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_a9183bd4","line":40,"in_reply_to":"ba15a1d1_b4d8951f","updated":"2015-09-23 13:42:46.000000000","message":"ok","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ee6608a104d5bdc600e3e0cb7ed3be4c8e33984a","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    try:"},{"line_number":45,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":46,"context_line":"            record \u003d StatusBarrier(object_id\u003dobject_id, entity\u003dentity,"},{"line_number":47,"context_line":"                                   status\u003dstatus, object_type\u003dobject_type)"},{"line_number":48,"context_line":"            context.session.add(record)"},{"line_number":49,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":50,"context_line":"        # an entry could be leftover from a previous transition."}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_f4dccde5","line":47,"updated":"2015-09-23 11:29:09.000000000","message":"I think no validation is needed here, but if you want to be pedant you can say that entity has to be a valid one. Honestly I would not do that as it adds very little and makes the feature a lot less usable by implementations which are not the reference one","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2ae57329a1fab139afd3bcd8ac99af312c760a7e","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    try:"},{"line_number":45,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":46,"context_line":"            record \u003d StatusBarrier(object_id\u003dobject_id, entity\u003dentity,"},{"line_number":47,"context_line":"                                   status\u003dstatus, object_type\u003dobject_type)"},{"line_number":48,"context_line":"            context.session.add(record)"},{"line_number":49,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":50,"context_line":"        # an entry could be leftover from a previous transition."}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_2e3e7128","line":47,"in_reply_to":"ba15a1d1_f4dccde5","updated":"2015-09-23 13:42:46.000000000","message":"i agree","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ee6608a104d5bdc600e3e0cb7ed3be4c8e33984a","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            context.session.add(record)"},{"line_number":49,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":50,"context_line":"        # an entry could be leftover from a previous transition."},{"line_number":51,"context_line":"        pass"},{"line_number":52,"context_line":"    LOG.debug(\"Transition to status %(status)s for %(otype)s object %(oid)s \""},{"line_number":53,"context_line":"              \"will not be triggered until allowed by entity %(entity)s.\","},{"line_number":54,"context_line":"              {\u0027status\u0027: status, \u0027entity\u0027: entity, \u0027oid\u0027: object_id,"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_5a792381","line":51,"updated":"2015-09-23 11:29:09.000000000","message":"In a year time we\u0027ll see weird behaviours on barriers that we won\u0027t be able to debug; the gate will be wedged and all neutron jobs will be moved to non-voting. The TC will add a \"completely screwed\" tag to Neutron. As you  have been selected for an experimental mission to Mars you are unreachable and know nothing about this.\n\nAfter 2 weeks someone will finally find out the problem was a cancelled DBDuplicateEntry exception in status_barriers.py - and then someone will have to jump on a spaceX ship with a katana made with Hattori Hanzo\u0027s steel, land on Mars, and make the red planet even redder with your blood.\n\nPlease add another log statement here - or make it clear that the record was already created before in the statement below","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2ae57329a1fab139afd3bcd8ac99af312c760a7e","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            context.session.add(record)"},{"line_number":49,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":50,"context_line":"        # an entry could be leftover from a previous transition."},{"line_number":51,"context_line":"        pass"},{"line_number":52,"context_line":"    LOG.debug(\"Transition to status %(status)s for %(otype)s object %(oid)s \""},{"line_number":53,"context_line":"              \"will not be triggered until allowed by entity %(entity)s.\","},{"line_number":54,"context_line":"              {\u0027status\u0027: status, \u0027entity\u0027: entity, \u0027oid\u0027: object_id,"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_ce1d75bf","line":51,"in_reply_to":"ba15a1d1_5a792381","updated":"2015-09-23 13:42:46.000000000","message":"Done","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ee6608a104d5bdc600e3e0cb7ed3be4c8e33984a","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # barrier."},{"line_number":78,"context_line":"        records \u003d context.session.query(StatusBarrier).filter("},{"line_number":79,"context_line":"            StatusBarrier.object_id \u003d\u003d object_id).filter("},{"line_number":80,"context_line":"            StatusBarrier.status \u003d\u003d status).with_lockmode(\u0027update\u0027).all()"},{"line_number":81,"context_line":"        for record in records:"},{"line_number":82,"context_line":"            if record.entity \u003d\u003d entity:"},{"line_number":83,"context_line":"                if len(records) \u003d\u003d 1:"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_9d4ed56d","line":80,"updated":"2015-09-23 11:29:09.000000000","message":"I think your point about number of records in patch set 7 is weak.\n\nYou can iterate in this way:\n\nrecord_counter \u003d 0:\nfor record in records:\n    # do your stuff\n    record_counter +\u003d1\n\nif record_counter \u003d\u003d 1:\n   msg \u003d \u0027fully satisfied\u0027\nelse:\n   msg  \u003d \u0027 i am still hungry, I\u0027ll have some cheese\u0027\n\n\nBut this is just pedantry. At best it\u0027s a relatively minor optimization we can do in a follow-up patch","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2ae57329a1fab139afd3bcd8ac99af312c760a7e","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # barrier."},{"line_number":78,"context_line":"        records \u003d context.session.query(StatusBarrier).filter("},{"line_number":79,"context_line":"            StatusBarrier.object_id \u003d\u003d object_id).filter("},{"line_number":80,"context_line":"            StatusBarrier.status \u003d\u003d status).with_lockmode(\u0027update\u0027).all()"},{"line_number":81,"context_line":"        for record in records:"},{"line_number":82,"context_line":"            if record.entity \u003d\u003d entity:"},{"line_number":83,"context_line":"                if len(records) \u003d\u003d 1:"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_e9a713a5","line":80,"in_reply_to":"ba15a1d1_9d4ed56d","updated":"2015-09-23 13:42:46.000000000","message":"it looked ugly when i did that. i\u0027ll catch in a follow-up","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5837741d2c756a30ebf74a9d69ab21b30cc3e823","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                else:"},{"line_number":88,"context_line":"                    msg \u003d \u0027Still waiting on entities: %s\u0027 % \u0027,\u0027.join("},{"line_number":89,"context_line":"                        [r.entity for r in records if r.entity !\u003d entity])"},{"line_number":90,"context_line":"                context.session.delete(record)"},{"line_number":91,"context_line":"                LOG.debug(\"Transition to status %(status)s by object %(oid)s \""},{"line_number":92,"context_line":"                          \"cleared by entity %(entity)s. %(msg)s\","},{"line_number":93,"context_line":"                          {\u0027status\u0027: status, \u0027oid\u0027: object_id,"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_8905377b","line":90,"updated":"2015-09-23 13:06:15.000000000","message":"can we use query.delete() instead of issuing queries one by one?","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2ae57329a1fab139afd3bcd8ac99af312c760a7e","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                else:"},{"line_number":88,"context_line":"                    msg \u003d \u0027Still waiting on entities: %s\u0027 % \u0027,\u0027.join("},{"line_number":89,"context_line":"                        [r.entity for r in records if r.entity !\u003d entity])"},{"line_number":90,"context_line":"                context.session.delete(record)"},{"line_number":91,"context_line":"                LOG.debug(\"Transition to status %(status)s by object %(oid)s \""},{"line_number":92,"context_line":"                          \"cleared by entity %(entity)s. %(msg)s\","},{"line_number":93,"context_line":"                          {\u0027status\u0027: status, \u0027oid\u0027: object_id,"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_c4755198","line":90,"in_reply_to":"ba15a1d1_8905377b","updated":"2015-09-23 13:42:46.000000000","message":"there will only be one record deleted per call","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1b09677e6aaddc82acffdb9d0def63f1964e3fea","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class StatusBarrier(model_base.BASEV2):"},{"line_number":37,"context_line":"    # the id of the thing we want to block from transitioning"},{"line_number":38,"context_line":"    object_id \u003d sa.Column(sa.String(36), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":39,"context_line":"    # object type is used to determine which callback topic to use"},{"line_number":40,"context_line":"    object_type \u003d sa.Column(sa.String(36), nullable\u003dFalse)"},{"line_number":41,"context_line":"    # the status that the entity wants to prevent (e.g. ACTIVE)"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_e648955e","line":38,"updated":"2015-09-25 21:08:23.000000000","message":"nit:  I wouldn\u0027t hold this patch up for this or even request a respin just for it but this class looks like a big block eye chart, especially with the addition of the garbage collection column.  Some blank lines between columns might help readability.","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"285cc3f29f84f7492d74a1997eada9c9dfadd893","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class StatusBarrier(model_base.BASEV2):"},{"line_number":37,"context_line":"    # the id of the thing we want to block from transitioning"},{"line_number":38,"context_line":"    object_id \u003d sa.Column(sa.String(36), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":39,"context_line":"    # object type is used to determine which callback topic to use"},{"line_number":40,"context_line":"    object_type \u003d sa.Column(sa.String(36), nullable\u003dFalse)"},{"line_number":41,"context_line":"    # the status that the entity wants to prevent (e.g. ACTIVE)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a1a9d01_7a168c56","line":38,"in_reply_to":"ba15a1d1_e648955e","updated":"2015-09-28 13:46:07.000000000","message":"It actually doubles up as an eyesight test.\nI think that is useful, isn\u0027t it?","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"97e7d8da26ac88ee115434e3766ab4a6a349d4a7","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        records \u003d context.session.query(StatusBarrier).filter("},{"line_number":91,"context_line":"            StatusBarrier.object_id \u003d\u003d object_id).filter("},{"line_number":92,"context_line":"            StatusBarrier.object_type \u003d\u003d object_type).filter("},{"line_number":93,"context_line":"            StatusBarrier.status \u003d\u003d status).with_lockmode(\u0027update\u0027).all()"},{"line_number":94,"context_line":"        for record in records:"},{"line_number":95,"context_line":"            if record.entity \u003d\u003d entity:"},{"line_number":96,"context_line":"                if len(records) \u003d\u003d 1:"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_53bedaae","line":93,"updated":"2015-09-23 17:43:50.000000000","message":"We try to avoid use of SELECT FOR UPDATE because the behaviour of this call and the subsequent UPDATE call in MySQL Galera in muti-writer mode is not the same as normal MySQL servers.","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"03fe5afbdd3cdf59b3a106a577bfb70eba9f7c12","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        records \u003d context.session.query(StatusBarrier).filter("},{"line_number":91,"context_line":"            StatusBarrier.object_id \u003d\u003d object_id).filter("},{"line_number":92,"context_line":"            StatusBarrier.object_type \u003d\u003d object_type).filter("},{"line_number":93,"context_line":"            StatusBarrier.status \u003d\u003d status).with_lockmode(\u0027update\u0027).all()"},{"line_number":94,"context_line":"        for record in records:"},{"line_number":95,"context_line":"            if record.entity \u003d\u003d entity:"},{"line_number":96,"context_line":"                if len(records) \u003d\u003d 1:"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_8b7e7a19","line":93,"in_reply_to":"ba15a1d1_53bedaae","updated":"2015-09-23 19:14:43.000000000","message":"I know but this was still the easiest thing to do. IIUC, the write set certification would throw a deadlock if there was a concurrent change so this thing would just start over (because of the \"@db_api.retry_db_errors\" decorator).","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"285cc3f29f84f7492d74a1997eada9c9dfadd893","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        records \u003d context.session.query(StatusBarrier).filter("},{"line_number":91,"context_line":"            StatusBarrier.object_id \u003d\u003d object_id).filter("},{"line_number":92,"context_line":"            StatusBarrier.object_type \u003d\u003d object_type).filter("},{"line_number":93,"context_line":"            StatusBarrier.status \u003d\u003d status).with_lockmode(\u0027update\u0027).all()"},{"line_number":94,"context_line":"        for record in records:"},{"line_number":95,"context_line":"            if record.entity \u003d\u003d entity:"},{"line_number":96,"context_line":"                if len(records) \u003d\u003d 1:"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a1a9d01_7d5be62e","line":93,"in_reply_to":"ba15a1d1_8b7e7a19","updated":"2015-09-28 13:46:07.000000000","message":"Also, I don\u0027t think the final word has been said wrt if there is any case is better to take the hit from write set certification failures rather than retrying an operation is compare-and-swap detects a collision.","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"285cc3f29f84f7492d74a1997eada9c9dfadd893","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    return barriers"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"def _barrier_to_tuple(record):"},{"line_number":142,"context_line":"    return (record.object_id, record.object_type, record.status,"},{"line_number":143,"context_line":"            record.entity, record.garbage_collector)"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"9a1a9d01_9dbb5ae5","line":141,"updated":"2015-09-28 13:46:07.000000000","message":"This could also be a method of the model class, but I have no strong opinion about it","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"285cc3f29f84f7492d74a1997eada9c9dfadd893","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                if barrier[4] \u003d\u003d self.id]"},{"line_number":157,"context_line":"        for (oid, otype, status, entity, gc_id) in ours:"},{"line_number":158,"context_line":"            satisfy_object_status_barrier(context, oid, otype, status, entity,"},{"line_number":159,"context_line":"                                          forced\u003dTrue)"},{"line_number":160,"context_line":"        # now we repopulate our list for next run and attempt to take any"},{"line_number":161,"context_line":"        # records that were held by other garbage collectors the last cycle."},{"line_number":162,"context_line":"        # this should not include the garbage collector id"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a1a9d01_fd45b6b2","line":159,"updated":"2015-09-28 13:46:07.000000000","message":"any barrier that has stayed inactive for a period is to be considered satisfied? are you sure that\u0027s safe?","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"285cc3f29f84f7492d74a1997eada9c9dfadd893","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        barriers_to_hijack \u003d [barrier for barrier in self.tracked_barriers"},{"line_number":164,"context_line":"                              if barrier[4] !\u003d self.id]"},{"line_number":165,"context_line":"        self.tracked_barriers \u003d mark_all_for_garbage_collection("},{"line_number":166,"context_line":"            context, self.id, barriers_to_hijack)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"_GC_INSTANCE \u003d None"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a1a9d01_3da00e90","line":166,"updated":"2015-09-28 13:46:07.000000000","message":"In the method called above you set a gc id for every barrier whose gc id is not self.id. That\u0027s fine, but then perhaps the additional condition at line 133 can be avoided, I guess..","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"}],"neutron/plugins/ml2/drivers/mech_agent.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"df23507d5163d581e43e5783982ae447c2b1ecab","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    def update_port_precommit(self, context):"},{"line_number":63,"context_line":"        if context.host \u003d\u003d context.original_host:"},{"line_number":64,"context_line":"            return"},{"line_number":65,"context_line":"        self._insert_provisioning_block(context)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def _insert_provisioning_block(self, context):"},{"line_number":68,"context_line":"        # we insert a status barrier to prevent the port from transitioning"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_662553c1","line":65,"updated":"2016-04-15 15:11:21.000000000","message":"Do you think the overhead is negligible here? Otherwise I\u0027d do the provisioning block only on updates that trigger the agent (eg: not for updates that change attributes such as \u0027name\u0027)","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"107ce5497e4b9f0395cb38ebf64bbba73c4f2cea","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    def update_port_precommit(self, context):"},{"line_number":63,"context_line":"        if context.host \u003d\u003d context.original_host:"},{"line_number":64,"context_line":"            return"},{"line_number":65,"context_line":"        self._insert_provisioning_block(context)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def _insert_provisioning_block(self, context):"},{"line_number":68,"context_line":"        # we insert a status barrier to prevent the port from transitioning"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_79e7ad12","line":65,"in_reply_to":"1a122d0e_662553c1","updated":"2016-04-15 15:58:09.000000000","message":"Yes, the majority of the update cases won\u0027t reach this line because of the host change check on L63. I only care to insert blocks for a migration. No point in putting in a block if the port is still on the same host.","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"17274c0a6d43bedccf5ae52ef1e24537e2013870","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    def update_port_precommit(self, context):"},{"line_number":63,"context_line":"        if context.host \u003d\u003d context.original_host:"},{"line_number":64,"context_line":"            return"},{"line_number":65,"context_line":"        self._insert_provisioning_block(context)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def _insert_provisioning_block(self, context):"},{"line_number":68,"context_line":"        # we insert a status barrier to prevent the port from transitioning"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_daa3459d","line":65,"in_reply_to":"1a122d0e_79e7ad12","updated":"2016-04-15 21:41:02.000000000","message":".... and I obviously managed to miss line 63. I have become a terrible reviewer.","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"df23507d5163d581e43e5783982ae447c2b1ecab","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        # to active until the agent reports back that the wiring is done"},{"line_number":70,"context_line":"        port \u003d context.current"},{"line_number":71,"context_line":"        if (context.host and port[\u0027status\u0027] in (constants.PORT_STATUS_DOWN,"},{"line_number":72,"context_line":"                                                constants.PORT_STATUS_BUILD)):"},{"line_number":73,"context_line":"            if context.host_agents(self.agent_type):"},{"line_number":74,"context_line":"                provisioning_blocks.add_provisioning_component("},{"line_number":75,"context_line":"                    context._plugin_context, port[\u0027id\u0027], resources.PORT,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_e1730db3","line":72,"updated":"2016-04-15 15:11:21.000000000","message":"I think - looking at current ML2 code - that is an active port is updated its status is still \u0027ACTIVE\u0027 when calling pre_commit. Is that correct? Are you inserting the block only when the status is DOWN or BUILD for a precise reason?","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"17274c0a6d43bedccf5ae52ef1e24537e2013870","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        # to active until the agent reports back that the wiring is done"},{"line_number":70,"context_line":"        port \u003d context.current"},{"line_number":71,"context_line":"        if (context.host and port[\u0027status\u0027] in (constants.PORT_STATUS_DOWN,"},{"line_number":72,"context_line":"                                                constants.PORT_STATUS_BUILD)):"},{"line_number":73,"context_line":"            if context.host_agents(self.agent_type):"},{"line_number":74,"context_line":"                provisioning_blocks.add_provisioning_component("},{"line_number":75,"context_line":"                    context._plugin_context, port[\u0027id\u0027], resources.PORT,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_1ac5bd3b","line":72,"in_reply_to":"1a122d0e_195dd9e9","updated":"2016-04-15 21:41:02.000000000","message":"There should not.\nMy question is actually about ML2 operations.\nwhen you do update an ACTIVE port, what\u0027s the status of port when you call precommit? Is it still ACTIVE, or did it change already?","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"825e1f80c4fa2ad34866330d9c3c1cb1fa2f20f9","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        # to active until the agent reports back that the wiring is done"},{"line_number":70,"context_line":"        port \u003d context.current"},{"line_number":71,"context_line":"        if (context.host and port[\u0027status\u0027] in (constants.PORT_STATUS_DOWN,"},{"line_number":72,"context_line":"                                                constants.PORT_STATUS_BUILD)):"},{"line_number":73,"context_line":"            if context.host_agents(self.agent_type):"},{"line_number":74,"context_line":"                provisioning_blocks.add_provisioning_component("},{"line_number":75,"context_line":"                    context._plugin_context, port[\u0027id\u0027], resources.PORT,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_2bbaed23","line":72,"in_reply_to":"1a122d0e_1ac5bd3b","updated":"2016-04-15 23:59:59.000000000","message":"Yes, if something happened that caused a status change (e.g. host_Id changed), that will all be done before update_port_precommit is called.\n\nhttps://github.com/openstack/neutron/blob/d9e2a65d6f1bf6738cb51d55d0fd927c3e3394ec/neutron/plugins/ml2/plugin.py#L473-L481","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"107ce5497e4b9f0395cb38ebf64bbba73c4f2cea","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        # to active until the agent reports back that the wiring is done"},{"line_number":70,"context_line":"        port \u003d context.current"},{"line_number":71,"context_line":"        if (context.host and port[\u0027status\u0027] in (constants.PORT_STATUS_DOWN,"},{"line_number":72,"context_line":"                                                constants.PORT_STATUS_BUILD)):"},{"line_number":73,"context_line":"            if context.host_agents(self.agent_type):"},{"line_number":74,"context_line":"                provisioning_blocks.add_provisioning_component("},{"line_number":75,"context_line":"                    context._plugin_context, port[\u0027id\u0027], resources.PORT,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_195dd9e9","line":72,"in_reply_to":"1a122d0e_e1730db3","updated":"2016-04-15 15:58:09.000000000","message":"My reasoning was that if a port is already ACTIVE, there isn\u0027t much of a point in putting in blocks.","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"df23507d5163d581e43e5783982ae447c2b1ecab","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            if context.host_agents(self.agent_type):"},{"line_number":74,"context_line":"                provisioning_blocks.add_provisioning_component("},{"line_number":75,"context_line":"                    context._plugin_context, port[\u0027id\u0027], resources.PORT,"},{"line_number":76,"context_line":"                    provisioning_blocks.L2_AGENT_ENTITY)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def bind_port(self, context):"},{"line_number":79,"context_line":"        LOG.debug(\"Attempting to bind port %(port)s on \""}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_a89c556a","line":76,"updated":"2016-04-15 15:11:21.000000000","message":"I would add all the provisioning blocks in a single transaction. Precommit seems like the right place to do that.\n\nThe reason for me is that otherwise - upon failures - not all provisionin blocks might be entered. For instance the DHCP block; this would result in port moving to \u0027UP\u0027 just with completion of L2 agent operations.","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"107ce5497e4b9f0395cb38ebf64bbba73c4f2cea","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            if context.host_agents(self.agent_type):"},{"line_number":74,"context_line":"                provisioning_blocks.add_provisioning_component("},{"line_number":75,"context_line":"                    context._plugin_context, port[\u0027id\u0027], resources.PORT,"},{"line_number":76,"context_line":"                    provisioning_blocks.L2_AGENT_ENTITY)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def bind_port(self, context):"},{"line_number":79,"context_line":"        LOG.debug(\"Attempting to bind port %(port)s on \""}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_b9c82576","line":76,"in_reply_to":"1a122d0e_a89c556a","updated":"2016-04-15 15:58:09.000000000","message":"ack. i\u0027ll see what i can do","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d7e2ccdc36257a4487e3f6a1e1abdaa251071f7c","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from neutron._i18n import _LW"},{"line_number":22,"context_line":"from neutron.callbacks import resources"},{"line_number":23,"context_line":"from neutron.common import constants"},{"line_number":24,"context_line":"from neutron.db import provisioning_blocks"},{"line_number":25,"context_line":"from neutron.extensions import portbindings"},{"line_number":26,"context_line":"from neutron.plugins.common import constants as p_constants"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_98116707","line":23,"updated":"2016-04-26 14:31:24.000000000","message":"Use neutron-lib constants now.","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5469f01a3bb7a73df5d7487f597ab719270922e2","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from neutron._i18n import _LW"},{"line_number":22,"context_line":"from neutron.callbacks import resources"},{"line_number":23,"context_line":"from neutron.common import constants"},{"line_number":24,"context_line":"from neutron.db import provisioning_blocks"},{"line_number":25,"context_line":"from neutron.extensions import portbindings"},{"line_number":26,"context_line":"from neutron.plugins.common import constants as p_constants"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_67c1bfe4","line":23,"in_reply_to":"1a122d0e_98116707","updated":"2016-05-07 00:52:43.000000000","message":"ditto","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"806b678860ca2994beae82f3f0069d77ef09de56","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            return"},{"line_number":74,"context_line":"        vnic_type \u003d context.current.get(portbindings.VNIC_TYPE,"},{"line_number":75,"context_line":"                                        portbindings.VNIC_NORMAL)"},{"line_number":76,"context_line":"        if vnic_type not in self.supported_vnic_types:"},{"line_number":77,"context_line":"            # we check the VNIC type because there could be multiple agents"},{"line_number":78,"context_line":"            # on a single host with different VNIC types"},{"line_number":79,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_05515036","line":76,"updated":"2016-05-10 21:28:07.000000000","message":"See L80?","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5469f01a3bb7a73df5d7487f597ab719270922e2","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            return"},{"line_number":74,"context_line":"        vnic_type \u003d context.current.get(portbindings.VNIC_TYPE,"},{"line_number":75,"context_line":"                                        portbindings.VNIC_NORMAL)"},{"line_number":76,"context_line":"        if vnic_type not in self.supported_vnic_types:"},{"line_number":77,"context_line":"            # we check the VNIC type because there could be multiple agents"},{"line_number":78,"context_line":"            # on a single host with different VNIC types"},{"line_number":79,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_0726f3cd","line":76,"updated":"2016-05-07 00:52:43.000000000","message":"what about agent_type?","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"806b678860ca2994beae82f3f0069d77ef09de56","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            return"},{"line_number":80,"context_line":"        if context.host_agents(self.agent_type):"},{"line_number":81,"context_line":"            provisioning_blocks.add_provisioning_component("},{"line_number":82,"context_line":"                context._plugin_context, port[\u0027id\u0027], resources.PORT,"},{"line_number":83,"context_line":"                provisioning_blocks.L2_AGENT_ENTITY)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def bind_port(self, context):"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_6542dc69","line":82,"updated":"2016-05-10 21:28:07.000000000","message":"Not yet. But there is one in the works: https://review.openstack.org/#/c/313197/","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5469f01a3bb7a73df5d7487f597ab719270922e2","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            return"},{"line_number":80,"context_line":"        if context.host_agents(self.agent_type):"},{"line_number":81,"context_line":"            provisioning_blocks.add_provisioning_component("},{"line_number":82,"context_line":"                context._plugin_context, port[\u0027id\u0027], resources.PORT,"},{"line_number":83,"context_line":"                provisioning_blocks.L2_AGENT_ENTITY)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def bind_port(self, context):"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_c73b4bea","line":82,"updated":"2016-05-07 00:52:43.000000000","message":"murder! context._plugin_context? Can we find out a cleaner way to get access to the request context?","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"}],"neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"99ad9c7b2239c23ecd72982497e6007e859e94a1","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                               \u0027tunnel_types\u0027: self.tunnel_types,"},{"line_number":206,"context_line":"                               \u0027tunneling_ip\u0027: local_ip,"},{"line_number":207,"context_line":"                               \u0027l2_population\u0027: self.l2_pop,"},{"line_number":208,"context_line":"                               \u0027notifies_port_ready\u0027: True,"},{"line_number":209,"context_line":"                               \u0027arp_responder_enabled\u0027:"},{"line_number":210,"context_line":"                               self.arp_responder_enabled,"},{"line_number":211,"context_line":"                               \u0027enable_distributed_routing\u0027:"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_118e6927","line":208,"updated":"2015-09-10 03:50:33.000000000","message":"I am not sure where this is consumed by the server. What am I missing?","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"271ac80ca81ab3381267782c3f8cbf5aed38a5dc","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                               \u0027tunnel_types\u0027: self.tunnel_types,"},{"line_number":206,"context_line":"                               \u0027tunneling_ip\u0027: local_ip,"},{"line_number":207,"context_line":"                               \u0027l2_population\u0027: self.l2_pop,"},{"line_number":208,"context_line":"                               \u0027notifies_port_ready\u0027: True,"},{"line_number":209,"context_line":"                               \u0027arp_responder_enabled\u0027:"},{"line_number":210,"context_line":"                               self.arp_responder_enabled,"},{"line_number":211,"context_line":"                               \u0027enable_distributed_routing\u0027:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_03426dae","line":208,"in_reply_to":"da20952f_118e6927","updated":"2015-09-16 15:01:10.000000000","message":"It\u0027s stored in agents_db, then we check whether it\u0027s set to decide whether status barrier is needed.\n\nneutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py line 144","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                               \u0027tunnel_types\u0027: self.tunnel_types,"},{"line_number":206,"context_line":"                               \u0027tunneling_ip\u0027: local_ip,"},{"line_number":207,"context_line":"                               \u0027l2_population\u0027: self.l2_pop,"},{"line_number":208,"context_line":"                               \u0027notifies_port_ready\u0027: True,"},{"line_number":209,"context_line":"                               \u0027arp_responder_enabled\u0027:"},{"line_number":210,"context_line":"                               self.arp_responder_enabled,"},{"line_number":211,"context_line":"                               \u0027enable_distributed_routing\u0027:"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_97c79611","line":208,"in_reply_to":"da20952f_118e6927","updated":"2015-09-23 01:23:57.000000000","message":"in the OVS mech driver. next page over","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8321bdbded43828b9907d715e48251336d38550c","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                               \u0027tunnel_types\u0027: self.tunnel_types,"},{"line_number":210,"context_line":"                               \u0027tunneling_ip\u0027: local_ip,"},{"line_number":211,"context_line":"                               \u0027l2_population\u0027: self.l2_pop,"},{"line_number":212,"context_line":"                               \u0027notifies_port_ready\u0027: True,"},{"line_number":213,"context_line":"                               \u0027arp_responder_enabled\u0027:"},{"line_number":214,"context_line":"                               self.arp_responder_enabled,"},{"line_number":215,"context_line":"                               \u0027enable_distributed_routing\u0027:"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_c5df9dd4","line":212,"updated":"2015-09-23 10:31:13.000000000","message":"to be consistent with dhcp agent, make it configurable","commit_id":"1509190dd426927f4e58dd340caabc4980e088a5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"0c5375d489b4a239b770686c884f65296a79e885","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                               \u0027tunnel_types\u0027: self.tunnel_types,"},{"line_number":210,"context_line":"                               \u0027tunneling_ip\u0027: local_ip,"},{"line_number":211,"context_line":"                               \u0027l2_population\u0027: self.l2_pop,"},{"line_number":212,"context_line":"                               \u0027notifies_port_ready\u0027: True,"},{"line_number":213,"context_line":"                               \u0027arp_responder_enabled\u0027:"},{"line_number":214,"context_line":"                               self.arp_responder_enabled,"},{"line_number":215,"context_line":"                               \u0027enable_distributed_routing\u0027:"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_94f4715b","line":212,"in_reply_to":"ba15a1d1_c5df9dd4","updated":"2015-09-23 13:58:36.000000000","message":"that will require a lot more logic because it would need to change what we call on the server side. It was easy for DHCP because it never did anything before.\n\nThere is also no point to shutting this off because it\u0027s basically the same behavior now if it\u0027s disabled for DHCP.","commit_id":"1509190dd426927f4e58dd340caabc4980e088a5"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"d8b4d2424348f03f4a6353e009a47de80d7e11dd","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                               \u0027tunnel_types\u0027: self.tunnel_types,"},{"line_number":210,"context_line":"                               \u0027tunneling_ip\u0027: local_ip,"},{"line_number":211,"context_line":"                               \u0027l2_population\u0027: self.l2_pop,"},{"line_number":212,"context_line":"                               \u0027notifies_port_ready\u0027: True,"},{"line_number":213,"context_line":"                               \u0027arp_responder_enabled\u0027:"},{"line_number":214,"context_line":"                               self.arp_responder_enabled,"},{"line_number":215,"context_line":"                               \u0027enable_distributed_routing\u0027:"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_66232559","line":212,"updated":"2015-09-23 16:00:06.000000000","message":"If it is a constant, there is no need to report it.","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"03fe5afbdd3cdf59b3a106a577bfb70eba9f7c12","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                               \u0027tunnel_types\u0027: self.tunnel_types,"},{"line_number":210,"context_line":"                               \u0027tunneling_ip\u0027: local_ip,"},{"line_number":211,"context_line":"                               \u0027l2_population\u0027: self.l2_pop,"},{"line_number":212,"context_line":"                               \u0027notifies_port_ready\u0027: True,"},{"line_number":213,"context_line":"                               \u0027arp_responder_enabled\u0027:"},{"line_number":214,"context_line":"                               self.arp_responder_enabled,"},{"line_number":215,"context_line":"                               \u0027enable_distributed_routing\u0027:"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_8b951a33","line":212,"in_reply_to":"ba15a1d1_66232559","updated":"2015-09-23 19:14:43.000000000","message":"server needs to know that it\u0027s a new enough agent to support this for the upgrade path. we don\u0027t want to put locks if the dhcp agent doesn\u0027t support it.","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"}],"neutron/plugins/ml2/drivers/openvswitch/mech_driver/mech_openvswitch.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"39a2cb2a8f64d623e18728a7f1d795265d316477","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        registry.subscribe(self._insert_port_status_barriers,"},{"line_number":50,"context_line":"                           resources.PORT, events.AFTER_CREATE)"},{"line_number":51,"context_line":"        registry.subscribe(self._insert_port_status_barriers,"},{"line_number":52,"context_line":"                           resources.PORT, events.AFTER_UPDATE)"},{"line_number":53,"context_line":"        super(OpenvswitchMechanismDriver, self).__init__("},{"line_number":54,"context_line":"            constants.AGENT_TYPE_OVS,"},{"line_number":55,"context_line":"            portbindings.VIF_TYPE_OVS,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_4a7afcf2","line":52,"updated":"2015-09-15 09:33:32.000000000","message":"uhmm not all port updates go to the agent - for instance when you update a name. I think the callback will still be called in that case however","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        registry.subscribe(self._insert_port_status_barriers,"},{"line_number":50,"context_line":"                           resources.PORT, events.AFTER_CREATE)"},{"line_number":51,"context_line":"        registry.subscribe(self._insert_port_status_barriers,"},{"line_number":52,"context_line":"                           resources.PORT, events.AFTER_UPDATE)"},{"line_number":53,"context_line":"        super(OpenvswitchMechanismDriver, self).__init__("},{"line_number":54,"context_line":"            constants.AGENT_TYPE_OVS,"},{"line_number":55,"context_line":"            portbindings.VIF_TYPE_OVS,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_8b5221dd","line":52,"in_reply_to":"ba15a1d1_4a7afcf2","updated":"2015-09-23 01:23:57.000000000","message":"that\u0027s true. I think it\u0027s ok in this particular case because we will just ensure there is a barrier to ACTIVE if it\u0027s down or building. However, there would be a small race where the L2 agent could have cleared the barrier and the name could have been updated right after before the DHCP agent cleared the barrier.\n\nI will fix this by adding the agent flag to the callback.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"271ac80ca81ab3381267782c3f8cbf5aed38a5dc","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            for agent in agents:"},{"line_number":83,"context_line":"                if agent[\u0027configurations\u0027].get(\u0027notifies_port_ready\u0027):"},{"line_number":84,"context_line":"                    status_barriers.add_object_status_barrier("},{"line_number":85,"context_line":"                        context, \u0027L2_AGENT\u0027, port[\u0027id\u0027],"},{"line_number":86,"context_line":"                        resources.PORT, constants.PORT_STATUS_ACTIVE)"},{"line_number":87,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_3e1ea65f","line":85,"updated":"2015-09-16 15:01:10.000000000","message":"nit: any reason why L2_AGENT entity is uppercase while dhcp is lowercase?","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            for agent in agents:"},{"line_number":83,"context_line":"                if agent[\u0027configurations\u0027].get(\u0027notifies_port_ready\u0027):"},{"line_number":84,"context_line":"                    status_barriers.add_object_status_barrier("},{"line_number":85,"context_line":"                        context, \u0027L2_AGENT\u0027, port[\u0027id\u0027],"},{"line_number":86,"context_line":"                        resources.PORT, constants.PORT_STATUS_ACTIVE)"},{"line_number":87,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_6bef8d1e","line":85,"in_reply_to":"ba15a1d1_3e1ea65f","updated":"2015-09-23 01:23:57.000000000","message":"corrected them in latest rev","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"d7f96fdd5136fc85d1287d5885f58ae4caf360d0","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        # on an update, we can see if it\u0027s a change that affected the agent"},{"line_number":76,"context_line":"        # with the agent_nofication_required param. if it didn\u0027t affect the"},{"line_number":77,"context_line":"        # agent we don\u0027t want to insert a barrier."},{"line_number":78,"context_line":"        agent_notified \u003d kwargs.get(\u0027agent_nofication_required\u0027, True)"},{"line_number":79,"context_line":"        if not agent_notified:"},{"line_number":80,"context_line":"            return"},{"line_number":81,"context_line":"        if (port[\u0027binding:host_id\u0027] and"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_dad8d320","line":78,"updated":"2015-09-23 11:03:28.000000000","message":"I don\u0027t know where this text is used. and make it constant?","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2ae57329a1fab139afd3bcd8ac99af312c760a7e","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        # on an update, we can see if it\u0027s a change that affected the agent"},{"line_number":76,"context_line":"        # with the agent_nofication_required param. if it didn\u0027t affect the"},{"line_number":77,"context_line":"        # agent we don\u0027t want to insert a barrier."},{"line_number":78,"context_line":"        agent_notified \u003d kwargs.get(\u0027agent_nofication_required\u0027, True)"},{"line_number":79,"context_line":"        if not agent_notified:"},{"line_number":80,"context_line":"            return"},{"line_number":81,"context_line":"        if (port[\u0027binding:host_id\u0027] and"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_20fa0076","line":78,"in_reply_to":"ba15a1d1_dad8d320","updated":"2015-09-23 13:42:46.000000000","message":"whoops. leftover not required anymore.","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"d7f96fdd5136fc85d1287d5885f58ae4caf360d0","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":85,"context_line":"            agents \u003d plugin.get_agents("},{"line_number":86,"context_line":"                context, filters\u003d{\u0027host\u0027: [port[\u0027binding:host_id\u0027]],"},{"line_number":87,"context_line":"                                  \u0027agent_type\u0027: [constants.AGENT_TYPE_OVS],"},{"line_number":88,"context_line":"                                  \u0027active\u0027: [True]})"},{"line_number":89,"context_line":"            for agent in agents:"},{"line_number":90,"context_line":"                if agent[\u0027configurations\u0027].get(\u0027notifies_port_ready\u0027):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_5a9cc30d","line":87,"updated":"2015-09-23 11:03:28.000000000","message":"where do we insert dhcp agent type?","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2ae57329a1fab139afd3bcd8ac99af312c760a7e","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":85,"context_line":"            agents \u003d plugin.get_agents("},{"line_number":86,"context_line":"                context, filters\u003d{\u0027host\u0027: [port[\u0027binding:host_id\u0027]],"},{"line_number":87,"context_line":"                                  \u0027agent_type\u0027: [constants.AGENT_TYPE_OVS],"},{"line_number":88,"context_line":"                                  \u0027active\u0027: [True]})"},{"line_number":89,"context_line":"            for agent in agents:"},{"line_number":90,"context_line":"                if agent[\u0027configurations\u0027].get(\u0027notifies_port_ready\u0027):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_80e98cb9","line":87,"in_reply_to":"ba15a1d1_5a9cc30d","updated":"2015-09-23 13:42:46.000000000","message":"dhcp is inserted in the dhcp agent notifier code","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"305c49bc1e3234461e245852c35ccfb34b51730e","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                                  \u0027agent_type\u0027: [constants.AGENT_TYPE_OVS],"},{"line_number":86,"context_line":"                                  \u0027active\u0027: [True]})"},{"line_number":87,"context_line":"            for agent in agents:"},{"line_number":88,"context_line":"                if agent[\u0027configurations\u0027].get(\u0027notifies_port_ready\u0027):"},{"line_number":89,"context_line":"                    status_barriers.add_object_status_barrier("},{"line_number":90,"context_line":"                        context, port[\u0027id\u0027], resources.PORT,"},{"line_number":91,"context_line":"                        constants.PORT_STATUS_ACTIVE,"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_876674eb","line":88,"updated":"2015-09-23 16:17:13.000000000","message":"since ovs agent \u0027s notifies_port_ready is always true, no need for this if.\n\nand it is odd that there are many ovs agent on one host, too.","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1b09677e6aaddc82acffdb9d0def63f1964e3fea","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                                  \u0027agent_type\u0027: [constants.AGENT_TYPE_OVS],"},{"line_number":86,"context_line":"                                  \u0027active\u0027: [True]})"},{"line_number":87,"context_line":"            for agent in agents:"},{"line_number":88,"context_line":"                if agent[\u0027configurations\u0027].get(\u0027notifies_port_ready\u0027):"},{"line_number":89,"context_line":"                    status_barriers.add_object_status_barrier("},{"line_number":90,"context_line":"                        context, port[\u0027id\u0027], resources.PORT,"},{"line_number":91,"context_line":"                        constants.PORT_STATUS_ACTIVE,"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_d8d209d1","line":88,"in_reply_to":"ba15a1d1_876674eb","updated":"2015-09-25 21:08:23.000000000","message":"I don\u0027t think we\u0027ll get multiple agents for the given host.  I think the list of agents returned will never be more than 1, will it?  The code might be better written something like this (unless I\u0027m mistaken about something):\n\nif agents:\n    agent \u003d agents[0]\n    ...","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"03fe5afbdd3cdf59b3a106a577bfb70eba9f7c12","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                                  \u0027agent_type\u0027: [constants.AGENT_TYPE_OVS],"},{"line_number":86,"context_line":"                                  \u0027active\u0027: [True]})"},{"line_number":87,"context_line":"            for agent in agents:"},{"line_number":88,"context_line":"                if agent[\u0027configurations\u0027].get(\u0027notifies_port_ready\u0027):"},{"line_number":89,"context_line":"                    status_barriers.add_object_status_barrier("},{"line_number":90,"context_line":"                        context, port[\u0027id\u0027], resources.PORT,"},{"line_number":91,"context_line":"                        constants.PORT_STATUS_ACTIVE,"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_4bcb8253","line":88,"in_reply_to":"ba15a1d1_876674eb","updated":"2015-09-23 19:14:43.000000000","message":"same comment for the dhcp agent. we have to have this to know the agent is new enough to call the barrier release.","commit_id":"6b78a6b6b6729459546cf39d345934ec8ac1fef3"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"45646ba3effb9a5cfbb7aaf263648ad1ab06fb5e","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        super(Ml2Plugin, self).__init__()"},{"line_number":141,"context_line":"        self.type_manager.initialize()"},{"line_number":142,"context_line":"        self.extension_manager.initialize()"},{"line_number":143,"context_line":"        self.mechanism_manager.initialize()"},{"line_number":144,"context_line":"        registry.subscribe(self._port_status_barrier_lifted,"},{"line_number":145,"context_line":"                           resources.PORT, events.STATUS_BARRIER_SATISFIED)"},{"line_number":146,"context_line":"        registry.subscribe(self._insert_port_status_barriers,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a0c5dc1_adb5497f","line":143,"updated":"2015-05-12 21:05:34.000000000","message":"I have to say kudos to Armando here, the callback system is really paying off. This is so much easier and cleaner than mucking about the different plugin methods, making sure you\u0027re placing the new calls in the right place...","commit_id":"a2aa616746fcc4d1ae5dc3ef7766941534e24c41"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"271ac80ca81ab3381267782c3f8cbf5aed38a5dc","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        port \u003d kwargs[\u0027port\u0027]"},{"line_number":163,"context_line":"        context \u003d kwargs[\u0027context\u0027]"},{"line_number":164,"context_line":"        if event \u003d\u003d events.AFTER_DELETE:"},{"line_number":165,"context_line":"            # we just clear all barriers on a delte"},{"line_number":166,"context_line":"            # TODO(kevinbenton): db referential integrity should do this"},{"line_number":167,"context_line":"            status \u003d None"},{"line_number":168,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_beef16e8","line":165,"updated":"2015-09-16 15:01:10.000000000","message":"delete","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        port \u003d kwargs[\u0027port\u0027]"},{"line_number":163,"context_line":"        context \u003d kwargs[\u0027context\u0027]"},{"line_number":164,"context_line":"        if event \u003d\u003d events.AFTER_DELETE:"},{"line_number":165,"context_line":"            # we just clear all barriers on a delte"},{"line_number":166,"context_line":"            # TODO(kevinbenton): db referential integrity should do this"},{"line_number":167,"context_line":"            status \u003d None"},{"line_number":168,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_2b119504","line":165,"in_reply_to":"ba15a1d1_beef16e8","updated":"2015-09-23 01:23:57.000000000","message":"Done","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"271ac80ca81ab3381267782c3f8cbf5aed38a5dc","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        context \u003d kwargs[\u0027context\u0027]"},{"line_number":164,"context_line":"        if event \u003d\u003d events.AFTER_DELETE:"},{"line_number":165,"context_line":"            # we just clear all barriers on a delte"},{"line_number":166,"context_line":"            # TODO(kevinbenton): db referential integrity should do this"},{"line_number":167,"context_line":"            status \u003d None"},{"line_number":168,"context_line":"        else:"},{"line_number":169,"context_line":"            # clear any barriers to the current status since the port has"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_dea8ca79","line":166,"updated":"2015-09-16 15:01:10.000000000","message":"then why do we handle it here?","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        context \u003d kwargs[\u0027context\u0027]"},{"line_number":164,"context_line":"        if event \u003d\u003d events.AFTER_DELETE:"},{"line_number":165,"context_line":"            # we just clear all barriers on a delte"},{"line_number":166,"context_line":"            # TODO(kevinbenton): db referential integrity should do this"},{"line_number":167,"context_line":"            status \u003d None"},{"line_number":168,"context_line":"        else:"},{"line_number":169,"context_line":"            # clear any barriers to the current status since the port has"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_ebf71dd1","line":166,"in_reply_to":"ba15a1d1_dea8ca79","updated":"2015-09-23 01:23:57.000000000","message":"we don\u0027t have a relationship yet. That will depend on the outcome of the neutronresources table patch.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"271ac80ca81ab3381267782c3f8cbf5aed38a5dc","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            status \u003d None"},{"line_number":168,"context_line":"        else:"},{"line_number":169,"context_line":"            # clear any barriers to the current status since the port has"},{"line_number":170,"context_line":"            # just transitioned there."},{"line_number":171,"context_line":"            status \u003d port[\u0027status\u0027]"},{"line_number":172,"context_line":"        status_barriers.clear_object_status_barriers(context, port[\u0027id\u0027],"},{"line_number":173,"context_line":"                                                     status)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_5e383a3d","line":170,"updated":"2015-09-16 15:01:10.000000000","message":"How can we get the status transitioned while barriers are still there? Thru API?","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            status \u003d None"},{"line_number":168,"context_line":"        else:"},{"line_number":169,"context_line":"            # clear any barriers to the current status since the port has"},{"line_number":170,"context_line":"            # just transitioned there."},{"line_number":171,"context_line":"            status \u003d port[\u0027status\u0027]"},{"line_number":172,"context_line":"        status_barriers.clear_object_status_barriers(context, port[\u0027id\u0027],"},{"line_number":173,"context_line":"                                                     status)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_8b1781ed","line":170,"in_reply_to":"ba15a1d1_5e383a3d","updated":"2015-09-23 01:23:57.000000000","message":"This occurs after the status has already been updated by something else. So we just get the status handed to us. This should be a warning condition. Let me update it to log that.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8321bdbded43828b9907d715e48251336d38550c","unresolved":false,"context_lines":[{"line_number":1033,"context_line":"    def create_port(self, context, port):"},{"line_number":1034,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":1035,"context_line":"        result, mech_context \u003d self._create_port_db(context, port)"},{"line_number":1036,"context_line":"        new_host_port \u003d self._get_host_port_if_changed(mech_context, attrs)"},{"line_number":1037,"context_line":"        # notify any plugin that is interested in port create events"},{"line_number":1038,"context_line":"        kwargs \u003d {\u0027context\u0027: context, \u0027port\u0027: new_host_port}"},{"line_number":1039,"context_line":"        registry.notify(resources.PORT, events.AFTER_CREATE, self, **kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_08cdac84","side":"PARENT","line":1036,"updated":"2015-09-23 10:31:13.000000000","message":"why delete this line?","commit_id":"7707cfd86f47dfc66411e274f343fe8484f9e250"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"0c5375d489b4a239b770686c884f65296a79e885","unresolved":false,"context_lines":[{"line_number":1033,"context_line":"    def create_port(self, context, port):"},{"line_number":1034,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":1035,"context_line":"        result, mech_context \u003d self._create_port_db(context, port)"},{"line_number":1036,"context_line":"        new_host_port \u003d self._get_host_port_if_changed(mech_context, attrs)"},{"line_number":1037,"context_line":"        # notify any plugin that is interested in port create events"},{"line_number":1038,"context_line":"        kwargs \u003d {\u0027context\u0027: context, \u0027port\u0027: new_host_port}"},{"line_number":1039,"context_line":"        registry.notify(resources.PORT, events.AFTER_CREATE, self, **kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_5a7fe316","side":"PARENT","line":1036,"in_reply_to":"ba15a1d1_08cdac84","updated":"2015-09-23 13:58:36.000000000","message":"we shouldn\u0027t conditionally notify","commit_id":"7707cfd86f47dfc66411e274f343fe8484f9e250"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"8321bdbded43828b9907d715e48251336d38550c","unresolved":false,"context_lines":[{"line_number":1098,"context_line":"            attrs \u003d obj[\u0027attributes\u0027]"},{"line_number":1099,"context_line":"            if attrs and attrs.get(portbindings.HOST_ID):"},{"line_number":1100,"context_line":"                new_host_port \u003d self._get_host_port_if_changed("},{"line_number":1101,"context_line":"                    obj[\u0027mech_context\u0027], attrs)"},{"line_number":1102,"context_line":"                kwargs \u003d {\u0027context\u0027: context, \u0027port\u0027: new_host_port}"},{"line_number":1103,"context_line":"                registry.notify("},{"line_number":1104,"context_line":"                    resources.PORT, events.AFTER_CREATE, self, **kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_08a28c99","line":1101,"updated":"2015-09-23 10:31:13.000000000","message":"need this line change?","commit_id":"1509190dd426927f4e58dd340caabc4980e088a5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"0c5375d489b4a239b770686c884f65296a79e885","unresolved":false,"context_lines":[{"line_number":1098,"context_line":"            attrs \u003d obj[\u0027attributes\u0027]"},{"line_number":1099,"context_line":"            if attrs and attrs.get(portbindings.HOST_ID):"},{"line_number":1100,"context_line":"                new_host_port \u003d self._get_host_port_if_changed("},{"line_number":1101,"context_line":"                    obj[\u0027mech_context\u0027], attrs)"},{"line_number":1102,"context_line":"                kwargs \u003d {\u0027context\u0027: context, \u0027port\u0027: new_host_port}"},{"line_number":1103,"context_line":"                registry.notify("},{"line_number":1104,"context_line":"                    resources.PORT, events.AFTER_CREATE, self, **kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_3af78f8c","line":1101,"in_reply_to":"ba15a1d1_08a28c99","updated":"2015-09-23 13:58:36.000000000","message":"Done","commit_id":"1509190dd426927f4e58dd340caabc4980e088a5"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"d7f96fdd5136fc85d1287d5885f58ae4caf360d0","unresolved":false,"context_lines":[{"line_number":171,"context_line":"                                                        status) and status:"},{"line_number":172,"context_line":"            LOG.warning(_LW(\"There were unsatisfied port status transition \""},{"line_number":173,"context_line":"                            \"barriers on port %(id)s, but it was advanced to \""},{"line_number":174,"context_line":"                            \"%(status)s anyway.\"), port)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _port_status_barrier_lifted(self, rtype, event, trigger,"},{"line_number":177,"context_line":"                                    context, status, object_id, **kwargs):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_d4b8a913","line":174,"updated":"2015-09-23 11:03:28.000000000","message":"{\u0027id\u0027: xx, \u0027status\u0027: yy\u0027?}","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2ae57329a1fab139afd3bcd8ac99af312c760a7e","unresolved":false,"context_lines":[{"line_number":171,"context_line":"                                                        status) and status:"},{"line_number":172,"context_line":"            LOG.warning(_LW(\"There were unsatisfied port status transition \""},{"line_number":173,"context_line":"                            \"barriers on port %(id)s, but it was advanced to \""},{"line_number":174,"context_line":"                            \"%(status)s anyway.\"), port)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _port_status_barrier_lifted(self, rtype, event, trigger,"},{"line_number":177,"context_line":"                                    context, status, object_id, **kwargs):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_e0aac870","line":174,"in_reply_to":"ba15a1d1_d4b8a913","updated":"2015-09-23 13:42:46.000000000","message":"it\u0027s extracted from the port dict","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ee6608a104d5bdc600e3e0cb7ed3be4c8e33984a","unresolved":false,"context_lines":[{"line_number":171,"context_line":"                                                        status) and status:"},{"line_number":172,"context_line":"            LOG.warning(_LW(\"There were unsatisfied port status transition \""},{"line_number":173,"context_line":"                            \"barriers on port %(id)s, but it was advanced to \""},{"line_number":174,"context_line":"                            \"%(status)s anyway.\"), port)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _port_status_barrier_lifted(self, rtype, event, trigger,"},{"line_number":177,"context_line":"                                    context, status, object_id, **kwargs):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_00e01c95","line":174,"in_reply_to":"ba15a1d1_d4b8a913","updated":"2015-09-23 11:29:09.000000000","message":"meh. port has those attributes so it\u0027s ok for me","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1b09677e6aaddc82acffdb9d0def63f1964e3fea","unresolved":false,"context_lines":[{"line_number":1033,"context_line":"    def create_port(self, context, port):"},{"line_number":1034,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":1035,"context_line":"        result, mech_context \u003d self._create_port_db(context, port)"},{"line_number":1036,"context_line":"        new_host_port \u003d self._get_host_port_if_changed(mech_context, attrs)"},{"line_number":1037,"context_line":"        # notify any plugin that is interested in port create events"},{"line_number":1038,"context_line":"        kwargs \u003d {\u0027context\u0027: context, \u0027port\u0027: new_host_port}"},{"line_number":1039,"context_line":"        registry.notify(resources.PORT, events.AFTER_CREATE, self, **kwargs)"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba15a1d1_79a41fa5","side":"PARENT","line":1036,"updated":"2015-09-25 21:08:23.000000000","message":"How are these changes related?","commit_id":"7707cfd86f47dfc66411e274f343fe8484f9e250"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"df23507d5163d581e43e5783982ae447c2b1ecab","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            # NOTE(kevinbenton): we hit here when a port is created without"},{"line_number":209,"context_line":"            # a host ID and the dhcp agent notifies that its wiring is done"},{"line_number":210,"context_line":"            LOG.debug(\"Port %s cannot update to ACTIVE because it \""},{"line_number":211,"context_line":"                      \"is not bound.\", port_id)"},{"line_number":212,"context_line":"            return"},{"line_number":213,"context_line":"        self.update_port_status(context, port_id, const.PORT_STATUS_ACTIVE)"},{"line_number":214,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_861d0fc0","line":211,"updated":"2016-04-15 15:11:21.000000000","message":"Would it be more correct if the port is put into an error state in this case?","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"107ce5497e4b9f0395cb38ebf64bbba73c4f2cea","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            # NOTE(kevinbenton): we hit here when a port is created without"},{"line_number":209,"context_line":"            # a host ID and the dhcp agent notifies that its wiring is done"},{"line_number":210,"context_line":"            LOG.debug(\"Port %s cannot update to ACTIVE because it \""},{"line_number":211,"context_line":"                      \"is not bound.\", port_id)"},{"line_number":212,"context_line":"            return"},{"line_number":213,"context_line":"        self.update_port_status(context, port_id, const.PORT_STATUS_ACTIVE)"},{"line_number":214,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_f9b57dd0","line":211,"in_reply_to":"1a122d0e_861d0fc0","updated":"2016-04-15 15:58:09.000000000","message":"I don\u0027t think so. The UNBOUND and DOWN state isn\u0027t really an error case. We just want to avoid pushing it to active just because the DHCP agent happened to setup the reservation for a port that isn\u0027t ready for use otherwise.","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"17274c0a6d43bedccf5ae52ef1e24537e2013870","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            # NOTE(kevinbenton): we hit here when a port is created without"},{"line_number":209,"context_line":"            # a host ID and the dhcp agent notifies that its wiring is done"},{"line_number":210,"context_line":"            LOG.debug(\"Port %s cannot update to ACTIVE because it \""},{"line_number":211,"context_line":"                      \"is not bound.\", port_id)"},{"line_number":212,"context_line":"            return"},{"line_number":213,"context_line":"        self.update_port_status(context, port_id, const.PORT_STATUS_ACTIVE)"},{"line_number":214,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_fac1e12f","line":211,"in_reply_to":"1a122d0e_f9b57dd0","updated":"2016-04-15 21:41:02.000000000","message":"That\u0027s reasonable.","commit_id":"46f1dcffd025d4273e45f477907d96ded07b71ba"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"5a3b2320c7c8b867805594f15608de8b9c8d5eb8","unresolved":false,"context_lines":[{"line_number":1630,"context_line":""},{"line_number":1631,"context_line":"    def port_bound_to_host(self, context, port_id, host):"},{"line_number":1632,"context_line":"        if not host:"},{"line_number":1633,"context_line":"            return False"},{"line_number":1634,"context_line":"        port \u003d db.get_port(context.session, port_id)"},{"line_number":1635,"context_line":"        if not port:"},{"line_number":1636,"context_line":"            LOG.debug(\"No Port match for: %s\", port_id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_28749c33","line":1633,"updated":"2016-04-18 06:14:12.000000000","message":"why False and not None?","commit_id":"6cd73cb3b280420ab740f9da7c69dd4e741f0078"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"fc66e0e8926ef38e31ccd7edf5966fe23aab6330","unresolved":false,"context_lines":[{"line_number":1630,"context_line":""},{"line_number":1631,"context_line":"    def port_bound_to_host(self, context, port_id, host):"},{"line_number":1632,"context_line":"        if not host:"},{"line_number":1633,"context_line":"            return False"},{"line_number":1634,"context_line":"        port \u003d db.get_port(context.session, port_id)"},{"line_number":1635,"context_line":"        if not port:"},{"line_number":1636,"context_line":"            LOG.debug(\"No Port match for: %s\", port_id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_ab0d0b92","line":1633,"in_reply_to":"1a122d0e_28749c33","updated":"2016-04-19 09:40:14.000000000","message":"I suppose I\u0027m changing the signature, might as well make it more consistent with other functions that return objects if they exist.","commit_id":"6cd73cb3b280420ab740f9da7c69dd4e741f0078"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"5a3b2320c7c8b867805594f15608de8b9c8d5eb8","unresolved":false,"context_lines":[{"line_number":1634,"context_line":"        port \u003d db.get_port(context.session, port_id)"},{"line_number":1635,"context_line":"        if not port:"},{"line_number":1636,"context_line":"            LOG.debug(\"No Port match for: %s\", port_id)"},{"line_number":1637,"context_line":"            return False"},{"line_number":1638,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d const.DEVICE_OWNER_DVR_INTERFACE:"},{"line_number":1639,"context_line":"            bindings \u003d db.get_dvr_port_bindings(context.session, port_id)"},{"line_number":1640,"context_line":"            for b in bindings:"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a122d0e_6894d436","line":1637,"updated":"2016-04-18 06:14:12.000000000","message":"ditto (unrelated)","commit_id":"6cd73cb3b280420ab740f9da7c69dd4e741f0078"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":1079,"context_line":"            return False"},{"line_number":1080,"context_line":"        return bool(context.session.query(models_v2.Subnet)."},{"line_number":1081,"context_line":"                    enable_eagerloads(False).filter_by(enable_dhcp\u003dTrue)."},{"line_number":1082,"context_line":"                    filter(models_v2.Subnet.id.in_(subnet_ids)).count())"},{"line_number":1083,"context_line":""},{"line_number":1084,"context_line":"    def _setup_dhcp_agent_provisioning_component(self, context, port):"},{"line_number":1085,"context_line":"        subnet_ids \u003d [f[\u0027subnet_id\u0027] for f in port[\u0027fixed_ips\u0027]]"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_7711b65c","line":1082,"updated":"2016-04-20 17:35:13.000000000","message":"I\u0027d rather wrap this into a db method and move it away from here.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":1079,"context_line":"            return False"},{"line_number":1080,"context_line":"        return bool(context.session.query(models_v2.Subnet)."},{"line_number":1081,"context_line":"                    enable_eagerloads(False).filter_by(enable_dhcp\u003dTrue)."},{"line_number":1082,"context_line":"                    filter(models_v2.Subnet.id.in_(subnet_ids)).count())"},{"line_number":1083,"context_line":""},{"line_number":1084,"context_line":"    def _setup_dhcp_agent_provisioning_component(self, context, port):"},{"line_number":1085,"context_line":"        subnet_ids \u003d [f[\u0027subnet_id\u0027] for f in port[\u0027fixed_ips\u0027]]"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_44cf8e55","line":1082,"updated":"2016-04-21 07:03:33.000000000","message":"Unfortunately it\u0027s not plugin agnostic like the rest of the DHCP agent scheduler code so I\u0027m not sure it makes sense for it to live there. Just in the ML2 DB module maybe?","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2827386346e3546660ce566ae9d9921284bba10f","unresolved":false,"context_lines":[{"line_number":1079,"context_line":"            return False"},{"line_number":1080,"context_line":"        return bool(context.session.query(models_v2.Subnet)."},{"line_number":1081,"context_line":"                    enable_eagerloads(False).filter_by(enable_dhcp\u003dTrue)."},{"line_number":1082,"context_line":"                    filter(models_v2.Subnet.id.in_(subnet_ids)).count())"},{"line_number":1083,"context_line":""},{"line_number":1084,"context_line":"    def _setup_dhcp_agent_provisioning_component(self, context, port):"},{"line_number":1085,"context_line":"        subnet_ids \u003d [f[\u0027subnet_id\u0027] for f in port[\u0027fixed_ips\u0027]]"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_23499f31","line":1082,"in_reply_to":"1a122d0e_44cf8e55","updated":"2016-04-21 10:22:55.000000000","message":"Actually nevermind. This can live in the agent scheduler code pretty well.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":1129,"context_line":"            self._process_port_create_extra_dhcp_opts(context, result,"},{"line_number":1130,"context_line":"                                                      dhcp_opts)"},{"line_number":1131,"context_line":"            self.mechanism_manager.create_port_precommit(mech_context)"},{"line_number":1132,"context_line":"            self._setup_dhcp_agent_provisioning_component(context, result)"},{"line_number":1133,"context_line":""},{"line_number":1134,"context_line":"        self._apply_dict_extend_functions(\u0027ports\u0027, result, port_db)"},{"line_number":1135,"context_line":"        return result, mech_context"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_a4dae214","line":1132,"updated":"2016-04-21 07:03:33.000000000","message":"I thought about that, but do we want to automatically have that happen for other plugins that don\u0027t bother to make the port status controlled by the provisioning blocks?","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":1129,"context_line":"            self._process_port_create_extra_dhcp_opts(context, result,"},{"line_number":1130,"context_line":"                                                      dhcp_opts)"},{"line_number":1131,"context_line":"            self.mechanism_manager.create_port_precommit(mech_context)"},{"line_number":1132,"context_line":"            self._setup_dhcp_agent_provisioning_component(context, result)"},{"line_number":1133,"context_line":""},{"line_number":1134,"context_line":"        self._apply_dict_extend_functions(\u0027ports\u0027, result, port_db)"},{"line_number":1135,"context_line":"        return result, mech_context"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_7256e406","line":1132,"updated":"2016-04-20 17:35:13.000000000","message":"since this is all about DB operations you could perhaps add a PRE_COMMIT registry even here and move this logic entirely out of the ML2 plugin.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f1b35044031672faa1496a16d59642aec42b194f","unresolved":false,"context_lines":[{"line_number":1129,"context_line":"            self._process_port_create_extra_dhcp_opts(context, result,"},{"line_number":1130,"context_line":"                                                      dhcp_opts)"},{"line_number":1131,"context_line":"            self.mechanism_manager.create_port_precommit(mech_context)"},{"line_number":1132,"context_line":"            self._setup_dhcp_agent_provisioning_component(context, result)"},{"line_number":1133,"context_line":""},{"line_number":1134,"context_line":"        self._apply_dict_extend_functions(\u0027ports\u0027, result, port_db)"},{"line_number":1135,"context_line":"        return result, mech_context"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_197159e1","line":1132,"in_reply_to":"1a122d0e_a4dae214","updated":"2016-04-21 17:30:49.000000000","message":"What I mean is that we can introduce a notify hook here. The callback subscribe can be done by ml2 alone, but the code can live elsewhere.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"8cc895d19e8519a090eb933f519116d9ecf80da3","unresolved":false,"context_lines":[{"line_number":1315,"context_line":"                    bound_mech_contexts.append(dvr_mech_context)"},{"line_number":1316,"context_line":"            else:"},{"line_number":1317,"context_line":"                self.mechanism_manager.update_port_precommit(mech_context)"},{"line_number":1318,"context_line":"                self._setup_dhcp_agent_provisioning_component("},{"line_number":1319,"context_line":"                    context, updated_port)"},{"line_number":1320,"context_line":"                bound_mech_contexts.append(mech_context)"},{"line_number":1321,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_f1cd8487","line":1318,"updated":"2016-04-22 04:00:51.000000000","message":"Yes, they may need to synchronize, but all of the logic will be different to determine if they need a block (e.g. they might do DHCP in non-agents so the agent alive and scheduling checks make no sense).","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":1315,"context_line":"                    bound_mech_contexts.append(dvr_mech_context)"},{"line_number":1316,"context_line":"            else:"},{"line_number":1317,"context_line":"                self.mechanism_manager.update_port_precommit(mech_context)"},{"line_number":1318,"context_line":"                self._setup_dhcp_agent_provisioning_component("},{"line_number":1319,"context_line":"                    context, updated_port)"},{"line_number":1320,"context_line":"                bound_mech_contexts.append(mech_context)"},{"line_number":1321,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_32774ca1","line":1318,"range":{"start_line":1318,"start_character":37,"end_line":1318,"end_character":38},"updated":"2016-04-20 17:35:13.000000000","message":"same here.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"fbb46b52de43ef7115e99a3c44a8874935cdb6dc","unresolved":false,"context_lines":[{"line_number":1315,"context_line":"                    bound_mech_contexts.append(dvr_mech_context)"},{"line_number":1316,"context_line":"            else:"},{"line_number":1317,"context_line":"                self.mechanism_manager.update_port_precommit(mech_context)"},{"line_number":1318,"context_line":"                self._setup_dhcp_agent_provisioning_component("},{"line_number":1319,"context_line":"                    context, updated_port)"},{"line_number":1320,"context_line":"                bound_mech_contexts.append(mech_context)"},{"line_number":1321,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_c3d54b1c","line":1318,"range":{"start_line":1318,"start_character":37,"end_line":1318,"end_character":38},"in_reply_to":"1a122d0e_32774ca1","updated":"2016-04-21 10:40:01.000000000","message":"Same question. Which component do you think should be responsible for subscribing then?","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7ddccfa878ab3bb94336441815bc88219910099b","unresolved":false,"context_lines":[{"line_number":1315,"context_line":"                    bound_mech_contexts.append(dvr_mech_context)"},{"line_number":1316,"context_line":"            else:"},{"line_number":1317,"context_line":"                self.mechanism_manager.update_port_precommit(mech_context)"},{"line_number":1318,"context_line":"                self._setup_dhcp_agent_provisioning_component("},{"line_number":1319,"context_line":"                    context, updated_port)"},{"line_number":1320,"context_line":"                bound_mech_contexts.append(mech_context)"},{"line_number":1321,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_e01f7407","line":1318,"range":{"start_line":1318,"start_character":37,"end_line":1318,"end_character":38},"in_reply_to":"1a122d0e_7a0dd136","updated":"2016-04-22 01:06:39.000000000","message":"If that\u0027s the case something is smelly (too coupled), or I may not fully understand the end-to-end set of interactions. My assumption is that any plugin should be able to participate in this process where the DHCP and the L2 plumbing are implemented as parallel activities that need to join before making a state transition of a port to active. Now a plugin might not rely on either or both the L2 and DHCP agent but the synchronization issue may still exist. No?","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"b95b95f637534059cf4ef940f7f56d3dbee0a873","unresolved":false,"context_lines":[{"line_number":1315,"context_line":"                    bound_mech_contexts.append(dvr_mech_context)"},{"line_number":1316,"context_line":"            else:"},{"line_number":1317,"context_line":"                self.mechanism_manager.update_port_precommit(mech_context)"},{"line_number":1318,"context_line":"                self._setup_dhcp_agent_provisioning_component("},{"line_number":1319,"context_line":"                    context, updated_port)"},{"line_number":1320,"context_line":"                bound_mech_contexts.append(mech_context)"},{"line_number":1321,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_7a0dd136","line":1318,"range":{"start_line":1318,"start_character":37,"end_line":1318,"end_character":38},"in_reply_to":"1a122d0e_99544922","updated":"2016-04-21 23:00:33.000000000","message":"I don\u0027t want to put the callback in the provisioning_blocks module for two reasons. The first is that its DHCP agent specific and nothing in that module is entity specific. The second is that this particular code is specific to ML2 in looking up the agents and DHCP enabled subnets. It seems the only place it makes sense for it to live is in ML2.\n\nI\u0027ll adjust this to use a callback, but I\u0027ll leave the code here for now until we figure out where to put it.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f1b35044031672faa1496a16d59642aec42b194f","unresolved":false,"context_lines":[{"line_number":1315,"context_line":"                    bound_mech_contexts.append(dvr_mech_context)"},{"line_number":1316,"context_line":"            else:"},{"line_number":1317,"context_line":"                self.mechanism_manager.update_port_precommit(mech_context)"},{"line_number":1318,"context_line":"                self._setup_dhcp_agent_provisioning_component("},{"line_number":1319,"context_line":"                    context, updated_port)"},{"line_number":1320,"context_line":"                bound_mech_contexts.append(mech_context)"},{"line_number":1321,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_99544922","line":1318,"range":{"start_line":1318,"start_character":37,"end_line":1318,"end_character":38},"in_reply_to":"1a122d0e_c3d54b1c","updated":"2016-04-21 17:30:49.000000000","message":"I am suggesting to add the notify hooks. That\u0027s beneficial a priori.\n\nThe callback can be a utility function available in the provisioning block method. ML2 can opt in to support the capability.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"806b678860ca2994beae82f3f0069d77ef09de56","unresolved":false,"context_lines":[{"line_number":166,"context_line":"                           resources.PORT, events.PRECOMMIT_UPDATE)"},{"line_number":167,"context_line":"        registry.subscribe(self._setup_dhcp_agent_provisioning_component,"},{"line_number":168,"context_line":"                           resources.PORT, events.PRECOMMIT_CREATE)"},{"line_number":169,"context_line":"        registry.subscribe(self._provision_complete_on_dhcp_disabled,"},{"line_number":170,"context_line":"                           resources.SUBNET, events.AFTER_UPDATE)"},{"line_number":171,"context_line":"        self._setup_dhcp()"},{"line_number":172,"context_line":"        self._start_rpc_notifiers()"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_254c549d","line":169,"updated":"2016-05-10 21:28:07.000000000","message":"If it gets re-enabled that function is a NOOP. I named it with \u0027disabled\u0027 since that\u0027s the only thing it takes action on.","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5469f01a3bb7a73df5d7487f597ab719270922e2","unresolved":false,"context_lines":[{"line_number":166,"context_line":"                           resources.PORT, events.PRECOMMIT_UPDATE)"},{"line_number":167,"context_line":"        registry.subscribe(self._setup_dhcp_agent_provisioning_component,"},{"line_number":168,"context_line":"                           resources.PORT, events.PRECOMMIT_CREATE)"},{"line_number":169,"context_line":"        registry.subscribe(self._provision_complete_on_dhcp_disabled,"},{"line_number":170,"context_line":"                           resources.SUBNET, events.AFTER_UPDATE)"},{"line_number":171,"context_line":"        self._setup_dhcp()"},{"line_number":172,"context_line":"        self._start_rpc_notifiers()"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_e7092f33","line":169,"updated":"2016-05-07 00:52:43.000000000","message":"what about if it gets re-enabled? Perhaps this can be renamed to:\n\n_provision_complete_on_dhcp_changes\n\nas it looks you can handle both cases?","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"f4c7ede8229427721f9bdc9487c6307c707304f0","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            LOG.debug(\"Port %s cannot update to ACTIVE because it \""},{"line_number":238,"context_line":"                      \"is not bound.\", port_id)"},{"line_number":239,"context_line":"            return"},{"line_number":240,"context_line":"        self.update_port_status(context, port_id, const.PORT_STATUS_ACTIVE)"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    @property"},{"line_number":243,"context_line":"    def supported_qos_rule_types(self):"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_91459944","line":240,"updated":"2016-04-27 22:58:38.000000000","message":"what prevents this happen on ports with admin_state_up\u003dfalse?","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"8d6d1363c53515c97c581b6b91fc2396b2060507","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            LOG.debug(\"Port %s cannot update to ACTIVE because it \""},{"line_number":238,"context_line":"                      \"is not bound.\", port_id)"},{"line_number":239,"context_line":"            return"},{"line_number":240,"context_line":"        self.update_port_status(context, port_id, const.PORT_STATUS_ACTIVE)"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    @property"},{"line_number":243,"context_line":"    def supported_qos_rule_types(self):"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_3ec6d299","line":240,"in_reply_to":"1a122d0e_91459944","updated":"2016-04-29 19:30:54.000000000","message":"Same logic as right now.","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"}],"neutron/plugins/ml2/rpc.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"271ac80ca81ab3381267782c3f8cbf5aed38a5dc","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":237,"context_line":"        port_id \u003d plugin._device_to_port_id(rpc_context, device)"},{"line_number":238,"context_line":"        status_barriers.satisfy_object_status_barrier("},{"line_number":239,"context_line":"            rpc_context, \u0027L2_AGENT\u0027, resources.PORT, port_id,"},{"line_number":240,"context_line":"            n_const.PORT_STATUS_ACTIVE)"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def update_device_list(self, rpc_context, **kwargs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_3e58e689","line":239,"updated":"2015-09-16 15:01:10.000000000","message":"that L2_AGENT literal should also have a reused constant.","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"92438319e15df1969962579e8060373e501db11f","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":237,"context_line":"        port_id \u003d plugin._device_to_port_id(rpc_context, device)"},{"line_number":238,"context_line":"        status_barriers.satisfy_object_status_barrier("},{"line_number":239,"context_line":"            rpc_context, \u0027L2_AGENT\u0027, resources.PORT, port_id,"},{"line_number":240,"context_line":"            n_const.PORT_STATUS_ACTIVE)"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def update_device_list(self, rpc_context, **kwargs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_6bc0ed50","line":239,"in_reply_to":"ba15a1d1_3e58e689","updated":"2015-09-23 01:23:57.000000000","message":"Done","commit_id":"e35e6337d01a1f6e0fb10d8e2bdc20f6f23cfafc"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5837741d2c756a30ebf74a9d69ab21b30cc3e823","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                    # update_device_list report back \u0027notifies_port_ready\u0027 in"},{"line_number":253,"context_line":"                    # their configuration so we just clear the barrier rather"},{"line_number":254,"context_line":"                    # than calling update_device_up directly."},{"line_number":255,"context_line":"                    self.l2_wiring_complete_on_device(rpc_context, device)"},{"line_number":256,"context_line":"                except Exception:"},{"line_number":257,"context_line":"                    failed_devices_up.append(device)"},{"line_number":258,"context_line":"                    LOG.exception(_LE(\"Failed to update device %s up\"), device)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_afd6fb4c","line":255,"updated":"2015-09-23 13:06:15.000000000","message":"I wonder if we could fold this into one call, considering that all devices are on one agent.\nThis could save a bit of server\u0027s resources.","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"2ae57329a1fab139afd3bcd8ac99af312c760a7e","unresolved":false,"context_lines":[{"line_number":252,"context_line":"                    # update_device_list report back \u0027notifies_port_ready\u0027 in"},{"line_number":253,"context_line":"                    # their configuration so we just clear the barrier rather"},{"line_number":254,"context_line":"                    # than calling update_device_up directly."},{"line_number":255,"context_line":"                    self.l2_wiring_complete_on_device(rpc_context, device)"},{"line_number":256,"context_line":"                except Exception:"},{"line_number":257,"context_line":"                    failed_devices_up.append(device)"},{"line_number":258,"context_line":"                    LOG.exception(_LE(\"Failed to update device %s up\"), device)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba15a1d1_610b172b","line":255,"in_reply_to":"ba15a1d1_afd6fb4c","updated":"2015-09-23 13:42:46.000000000","message":"well we don\u0027t have a bulk port update to turn this into so it wouldn\u0027t help too much.","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"df8966ca60c9904008774b976d391de787a0214e","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        else:"},{"line_number":219,"context_line":"            provisioning_blocks.provisioning_complete("},{"line_number":220,"context_line":"                rpc_context, port_id, resources.PORT,"},{"line_number":221,"context_line":"                provisioning_blocks.L2_AGENT_ENTITY)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def update_device_list(self, rpc_context, **kwargs):"},{"line_number":224,"context_line":"        devices_up \u003d []"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_323aac99","line":221,"updated":"2016-04-20 17:35:13.000000000","message":"I need to digest more why this change but if you elaborated it\u0027ll help me get there faster.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"89054c57d4332353903ce2b93810877c0c643389","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        else:"},{"line_number":219,"context_line":"            provisioning_blocks.provisioning_complete("},{"line_number":220,"context_line":"                rpc_context, port_id, resources.PORT,"},{"line_number":221,"context_line":"                provisioning_blocks.L2_AGENT_ENTITY)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def update_device_list(self, rpc_context, **kwargs):"},{"line_number":224,"context_line":"        devices_up \u003d []"}],"source_content_type":"text/x-python","patch_set":22,"id":"1a122d0e_84d526e6","line":221,"updated":"2016-04-21 07:03:33.000000000","message":"If we just directly call update_port_status from this method, all of the provisioning_blocks will be skipped and the port will transition to ACTIVE. When an L2 agent calls update_device_up, we no longer want to update the port status directly, we just want to remove the provisioning block for the L2 agent.","commit_id":"716f3a867b89abf673f811a7e5dffee255b98482"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"806b678860ca2994beae82f3f0069d77ef09de56","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        return {\u0027device\u0027: device,"},{"line_number":196,"context_line":"                \u0027exists\u0027: port_exists}"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"    def update_device_up(self, rpc_context, **kwargs):"},{"line_number":199,"context_line":"        \"\"\"Device is up on agent.\"\"\""},{"line_number":200,"context_line":"        agent_id \u003d kwargs.get(\u0027agent_id\u0027)"},{"line_number":201,"context_line":"        device \u003d kwargs.get(\u0027device\u0027)"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_2565741d","line":198,"updated":"2016-05-10 21:28:07.000000000","message":"Yes, if the driver didn\u0027t bother to put in any provisioning blocks, this effectively is still a call to update_port_status with just more stuff in the middle.","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5469f01a3bb7a73df5d7487f597ab719270922e2","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        return {\u0027device\u0027: device,"},{"line_number":196,"context_line":"                \u0027exists\u0027: port_exists}"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"    def update_device_up(self, rpc_context, **kwargs):"},{"line_number":199,"context_line":"        \"\"\"Device is up on agent.\"\"\""},{"line_number":200,"context_line":"        agent_id \u003d kwargs.get(\u0027agent_id\u0027)"},{"line_number":201,"context_line":"        device \u003d kwargs.get(\u0027device\u0027)"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_ba573e01","line":198,"updated":"2016-05-07 00:52:43.000000000","message":"would this logic now work for any mech driver?","commit_id":"7fa7ee9899ae5c55bf62fcd426baeb6e9390f9c5"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"68e802d4eb227bea6fb4d282d8e3c536ab6e26f1","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            # need to look up the full one before calling provisioning_complete"},{"line_number":223,"context_line":"            if not port:"},{"line_number":224,"context_line":"                port \u003d ml2_db.get_port(rpc_context.session, port_id)"},{"line_number":225,"context_line":"            if not port:"},{"line_number":226,"context_line":"                # port doesn\u0027t exist, no need to add a provisioning block"},{"line_number":227,"context_line":"                return"},{"line_number":228,"context_line":"            provisioning_blocks.provisioning_complete("}],"source_content_type":"text/x-python","patch_set":27,"id":"dab17558_9d4719bb","line":225,"range":{"start_line":225,"start_character":12,"end_line":225,"end_character":24},"updated":"2016-05-17 20:26:09.000000000","message":"nit:  indent 4 spaces","commit_id":"b672c26cb42ad3d9a17ed049b506b5622601e891"}],"neutron/tests/unit/plugins/ml2/test_plugin.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"ee6608a104d5bdc600e3e0cb7ed3be4c8e33984a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"ba15a1d1_6038f8ee","updated":"2015-09-23 11:29:09.000000000","message":"Do you think you might need some unit tests specific to the ml2 plugin to ensure that the code paths for adding/removing barriers are called as expected?","commit_id":"0181766204f0f3c92f9e7490df5ff45f57198d1c"}]}
