)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"251c43a5dbe1beea2748a8037514102eac4a827f","unresolved":false,"context_lines":[{"line_number":26,"context_line":"way, we can sort all message which cached in `ExclusiveResourceProcessor` by"},{"line_number":27,"context_line":"priority."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Related-Bug: #1760047"},{"line_number":30,"context_line":"Change-Id: I255caa0571c42fb012fe882259ef181070beccef"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"9fdfeff1_aa654747","line":29,"updated":"2019-01-23 08:58:28.000000000","message":"Should this be \"related-bug\" or maybe \"closes-bug\"?","commit_id":"9482ce15b0aade2b859ce303947a1b08d2076b47"},{"author":{"_account_id":28329,"name":"yangjianfeng","display_name":"JeffYang","email":"yjf1970231893@gmail.com","username":"yangjianfeng"},"change_message_id":"1fbe3d9c788bf8bd516e4eea36e0dbd40d452567","unresolved":false,"context_lines":[{"line_number":26,"context_line":"way, we can sort all message which cached in `ExclusiveResourceProcessor` by"},{"line_number":27,"context_line":"priority."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Related-Bug: #1760047"},{"line_number":30,"context_line":"Change-Id: I255caa0571c42fb012fe882259ef181070beccef"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"9fdfeff1_42a2724d","line":29,"in_reply_to":"9fdfeff1_aa654747","updated":"2019-01-24 01:50:04.000000000","message":"I think this patch not fully resolved the bug. If a network only has one dhcp-agent, the patch can\u0027t improve the dhcp provisioning process.","commit_id":"9482ce15b0aade2b859ce303947a1b08d2076b47"}],"neutron/agent/dhcp/agent.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d3bf73f925430735d9e502dd522b61c037a4404d","unresolved":false,"context_lines":[{"line_number":380,"context_line":"    def network_create_end(self, context, payload):"},{"line_number":381,"context_line":"        \"\"\"Handle the network.create.end notification event.\"\"\""},{"line_number":382,"context_line":"        update \u003d queue.ResourceUpdate(payload[\u0027network\u0027][\u0027id\u0027],"},{"line_number":383,"context_line":"                                      payload[\u0027priority\u0027],"},{"line_number":384,"context_line":"                                      action\u003d\u0027network_create\u0027,"},{"line_number":385,"context_line":"                                      resource\u003dpayload)"},{"line_number":386,"context_line":"        self._queue.add(update)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1f769fc5_7d3b82ea","line":383,"updated":"2019-01-02 20:18:39.000000000","message":"So the only problem with this is that a new agent can\u0027t operate with an old server, but an upgrade is supposed to be server first, agent second.","commit_id":"0d7c14d6a9ee75e464c4170104865d641765ab82"},{"author":{"_account_id":28329,"name":"yangjianfeng","display_name":"JeffYang","email":"yjf1970231893@gmail.com","username":"yangjianfeng"},"change_message_id":"1e4630c85f344610687e6ed8e6f370729d6efb05","unresolved":false,"context_lines":[{"line_number":380,"context_line":"    def network_create_end(self, context, payload):"},{"line_number":381,"context_line":"        \"\"\"Handle the network.create.end notification event.\"\"\""},{"line_number":382,"context_line":"        update \u003d queue.ResourceUpdate(payload[\u0027network\u0027][\u0027id\u0027],"},{"line_number":383,"context_line":"                                      payload[\u0027priority\u0027],"},{"line_number":384,"context_line":"                                      action\u003d\u0027network_create\u0027,"},{"line_number":385,"context_line":"                                      resource\u003dpayload)"},{"line_number":386,"context_line":"        self._queue.add(update)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ffd0ebdf_a69dbe67","line":383,"in_reply_to":"1f769fc5_7d3b82ea","updated":"2019-01-03 06:37:40.000000000","message":"Done","commit_id":"0d7c14d6a9ee75e464c4170104865d641765ab82"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d3bf73f925430735d9e502dd522b61c037a4404d","unresolved":false,"context_lines":[{"line_number":484,"context_line":""},{"line_number":485,"context_line":"    def _process_resource_update(self):"},{"line_number":486,"context_line":"        for tmp, update in self._queue.each_update_to_next_resource():"},{"line_number":487,"context_line":"            method \u003d getattr(self, \u0027_\u0027 + update.action)"},{"line_number":488,"context_line":"            method(update.resource)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def port_update_end(self, context, payload):"}],"source_content_type":"text/x-python","patch_set":8,"id":"1f769fc5_bda11aac","line":487,"updated":"2019-01-02 20:18:39.000000000","message":"I guess you can do it this way or just set the update.action to \"_network_create\" for example.  It just took me a second to figure out how they were called so figured I\u0027d add a comment.  Even if you just add a comment to that effect I\u0027m fine with it.","commit_id":"0d7c14d6a9ee75e464c4170104865d641765ab82"},{"author":{"_account_id":28329,"name":"yangjianfeng","display_name":"JeffYang","email":"yjf1970231893@gmail.com","username":"yangjianfeng"},"change_message_id":"1e4630c85f344610687e6ed8e6f370729d6efb05","unresolved":false,"context_lines":[{"line_number":484,"context_line":""},{"line_number":485,"context_line":"    def _process_resource_update(self):"},{"line_number":486,"context_line":"        for tmp, update in self._queue.each_update_to_next_resource():"},{"line_number":487,"context_line":"            method \u003d getattr(self, \u0027_\u0027 + update.action)"},{"line_number":488,"context_line":"            method(update.resource)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def port_update_end(self, context, payload):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ffd0ebdf_c69a426d","line":487,"in_reply_to":"1f769fc5_bda11aac","updated":"2019-01-03 06:37:40.000000000","message":"Done","commit_id":"0d7c14d6a9ee75e464c4170104865d641765ab82"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c17d8558e76dae94085ce301c493a5382b336394","unresolved":false,"context_lines":[{"line_number":485,"context_line":"    def _process_resource_update(self):"},{"line_number":486,"context_line":"        for tmp, update in self._queue.each_update_to_next_resource():"},{"line_number":487,"context_line":"            method \u003d getattr(self, update.action)"},{"line_number":488,"context_line":"            method(update.resource)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def port_update_end(self, context, payload):"},{"line_number":491,"context_line":"        \"\"\"Handle the port.update.end notification event.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"bfdaf3ff_39afb395","line":488,"updated":"2019-01-10 21:31:21.000000000","message":"So I guess this never has to call tmp.fetched_and_processed(...) since none of the methods ever re-enqueue the update.","commit_id":"9ad6b155e57a4fcbf86174ca847066707d698a33"},{"author":{"_account_id":28329,"name":"yangjianfeng","display_name":"JeffYang","email":"yjf1970231893@gmail.com","username":"yangjianfeng"},"change_message_id":"57423b3ce2f577b8f9114bc64e1c16c085aa1fc4","unresolved":false,"context_lines":[{"line_number":485,"context_line":"    def _process_resource_update(self):"},{"line_number":486,"context_line":"        for tmp, update in self._queue.each_update_to_next_resource():"},{"line_number":487,"context_line":"            method \u003d getattr(self, update.action)"},{"line_number":488,"context_line":"            method(update.resource)"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":"    def port_update_end(self, context, payload):"},{"line_number":491,"context_line":"        \"\"\"Handle the port.update.end notification event.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"bfdaf3ff_86409a37","line":488,"in_reply_to":"bfdaf3ff_39afb395","updated":"2019-01-13 04:43:02.000000000","message":"Yes, It won\u0027t be used.","commit_id":"9ad6b155e57a4fcbf86174ca847066707d698a33"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"251c43a5dbe1beea2748a8037514102eac4a827f","unresolved":false,"context_lines":[{"line_number":380,"context_line":"    def network_create_end(self, context, payload):"},{"line_number":381,"context_line":"        \"\"\"Handle the network.create.end notification event.\"\"\""},{"line_number":382,"context_line":"        update \u003d queue.ResourceUpdate(payload[\u0027network\u0027][\u0027id\u0027],"},{"line_number":383,"context_line":"                                      payload.get(\u0027priority\u0027),"},{"line_number":384,"context_line":"                                      action\u003d\u0027_network_create\u0027,"},{"line_number":385,"context_line":"                                      resource\u003dpayload)"},{"line_number":386,"context_line":"        self._queue.add(update)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_8dff3d00","line":383,"updated":"2019-01-23 08:58:28.000000000","message":"maybe You should define some DEFAULT_PRIORITY to return here instead of None","commit_id":"9482ce15b0aade2b859ce303947a1b08d2076b47"},{"author":{"_account_id":28329,"name":"yangjianfeng","display_name":"JeffYang","email":"yjf1970231893@gmail.com","username":"yangjianfeng"},"change_message_id":"78853972844ad54731c42acd1d5fa0177bc4b3a7","unresolved":false,"context_lines":[{"line_number":380,"context_line":"    def network_create_end(self, context, payload):"},{"line_number":381,"context_line":"        \"\"\"Handle the network.create.end notification event.\"\"\""},{"line_number":382,"context_line":"        update \u003d queue.ResourceUpdate(payload[\u0027network\u0027][\u0027id\u0027],"},{"line_number":383,"context_line":"                                      payload.get(\u0027priority\u0027),"},{"line_number":384,"context_line":"                                      action\u003d\u0027_network_create\u0027,"},{"line_number":385,"context_line":"                                      resource\u003dpayload)"},{"line_number":386,"context_line":"        self._queue.add(update)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_62a1b6a9","line":383,"in_reply_to":"9fdfeff1_8dff3d00","updated":"2019-01-24 01:15:14.000000000","message":"Yes, The \u0027None\u0027 will cause a potential exception in resource_processing_queue.","commit_id":"9482ce15b0aade2b859ce303947a1b08d2076b47"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3a5d7890e8f56096b6a94866997c7bc725ceb95a","unresolved":false,"context_lines":[{"line_number":380,"context_line":"    def network_create_end(self, context, payload):"},{"line_number":381,"context_line":"        \"\"\"Handle the network.create.end notification event.\"\"\""},{"line_number":382,"context_line":"        update \u003d queue.ResourceUpdate(payload[\u0027network\u0027][\u0027id\u0027],"},{"line_number":383,"context_line":"                                      payload.get(\u0027priority\u0027, 255),"},{"line_number":384,"context_line":"                                      action\u003d\u0027_network_create\u0027,"},{"line_number":385,"context_line":"                                      resource\u003dpayload)"},{"line_number":386,"context_line":"        self._queue.add(update)"}],"source_content_type":"text/x-python","patch_set":19,"id":"9fdfeff1_429fcd02","line":383,"range":{"start_line":383,"start_character":62,"end_line":383,"end_character":65},"updated":"2019-01-24 08:45:39.000000000","message":"IMO You should use some constant here, like DEFAULT_PRIORITY or something like that instead of \"magic\" number","commit_id":"95b2df66a3adca788912849ab8876a5a1fcb6e01"}],"neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d3bf73f925430735d9e502dd522b61c037a4404d","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"OTHER_PRIORITY \u003d 2"},{"line_number":32,"context_line":"PORT_UPDATE_PRIORITY \u003d 1"},{"line_number":33,"context_line":"NETWORK_CREATE_PRIORITY \u003d 0"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1f769fc5_7d84e20c","line":33,"updated":"2019-01-02 20:18:39.000000000","message":"nit: put in priority order, 0-\u003e2, and maybe use the same comment the l3-agent does:\n\n# Priorities - lower value is higher priority","commit_id":"0d7c14d6a9ee75e464c4170104865d641765ab82"},{"author":{"_account_id":28329,"name":"yangjianfeng","display_name":"JeffYang","email":"yjf1970231893@gmail.com","username":"yangjianfeng"},"change_message_id":"1e4630c85f344610687e6ed8e6f370729d6efb05","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"OTHER_PRIORITY \u003d 2"},{"line_number":32,"context_line":"PORT_UPDATE_PRIORITY \u003d 1"},{"line_number":33,"context_line":"NETWORK_CREATE_PRIORITY \u003d 0"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ffd0ebdf_26830e07","line":33,"in_reply_to":"1f769fc5_7d84e20c","updated":"2019-01-03 06:37:40.000000000","message":"Done","commit_id":"0d7c14d6a9ee75e464c4170104865d641765ab82"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d3bf73f925430735d9e502dd522b61c037a4404d","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            if method in (\u0027port_create_end\u0027 or \u0027port_update_end\u0027):"},{"line_number":196,"context_line":"                high_agent \u003d enabled_agents.pop("},{"line_number":197,"context_line":"                    random.randint(0, len(enabled_agents) - 1))"},{"line_number":198,"context_line":"                payload[\u0027priority\u0027] \u003d PORT_UPDATE_PRIORITY"},{"line_number":199,"context_line":"                self._cast_message("},{"line_number":200,"context_line":"                    context, method, payload,"},{"line_number":201,"context_line":"                    high_agent.host, high_agent.topic)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1f769fc5_3da3caa0","line":198,"updated":"2019-01-02 20:18:39.000000000","message":"So why does one agent get a higher priority than the others?\n\nWhich is why you couldn\u0027t do this in the agent.","commit_id":"0d7c14d6a9ee75e464c4170104865d641765ab82"},{"author":{"_account_id":28329,"name":"yangjianfeng","display_name":"JeffYang","email":"yjf1970231893@gmail.com","username":"yangjianfeng"},"change_message_id":"3d9087f36736f3b77206c9dbdaf411c419f8bfad","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            if method in (\u0027port_create_end\u0027 or \u0027port_update_end\u0027):"},{"line_number":196,"context_line":"                high_agent \u003d enabled_agents.pop("},{"line_number":197,"context_line":"                    random.randint(0, len(enabled_agents) - 1))"},{"line_number":198,"context_line":"                payload[\u0027priority\u0027] \u003d PORT_UPDATE_PRIORITY"},{"line_number":199,"context_line":"                self._cast_message("},{"line_number":200,"context_line":"                    context, method, payload,"},{"line_number":201,"context_line":"                    high_agent.host, high_agent.topic)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ffd0ebdf_e6966695","line":198,"in_reply_to":"1f769fc5_3da3caa0","updated":"2019-01-03 06:09:11.000000000","message":"Those code aim to fixed this bug: https://bugs.launchpad.net/neutron/+bug/1760047. In this way, When there are a large number of ports that need to be processed, we can dispatch the high priority message of port to different agent, so that the processed port will not block other port\u0027s processing in other dhcp agents.","commit_id":"0d7c14d6a9ee75e464c4170104865d641765ab82"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"79d7744dda6836dd94b93124c8a8066bd805c83b","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"from neutron.common import rpc as n_rpc"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"NETWORK_CREATE_PRIORITY \u003d 0"},{"line_number":32,"context_line":"PORT_UPDATE_PRIORITY \u003d 1"},{"line_number":33,"context_line":"OTHER_PRIORITY \u003d 2"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ffd0ebdf_06ed9cee","line":31,"updated":"2019-01-03 20:04:07.000000000","message":"Can you just add a comment above this so it\u0027s obvious:\n\n# Priorities - lower value is higher priority","commit_id":"d8a5186e1c9ac3ad1d408bd536dd270c8491adf9"},{"author":{"_account_id":28329,"name":"yangjianfeng","display_name":"JeffYang","email":"yjf1970231893@gmail.com","username":"yangjianfeng"},"change_message_id":"37a761527c3eaae0c875f019d965919f3594561a","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"from neutron.common import rpc as n_rpc"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"NETWORK_CREATE_PRIORITY \u003d 0"},{"line_number":32,"context_line":"PORT_UPDATE_PRIORITY \u003d 1"},{"line_number":33,"context_line":"OTHER_PRIORITY \u003d 2"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ffd0ebdf_559ee807","line":31,"in_reply_to":"ffd0ebdf_06ed9cee","updated":"2019-01-04 02:11:06.000000000","message":"Sorry, this is my fault. thanks for your reminding again.","commit_id":"d8a5186e1c9ac3ad1d408bd536dd270c8491adf9"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"79d7744dda6836dd94b93124c8a8066bd805c83b","unresolved":false,"context_lines":[{"line_number":207,"context_line":"                self._cast_message("},{"line_number":208,"context_line":"                    context, method, payload,"},{"line_number":209,"context_line":"                    high_agent.host, high_agent.topic)"},{"line_number":210,"context_line":"            payload[\u0027priority\u0027] \u003d OTHER_PRIORITY"},{"line_number":211,"context_line":"            for agent in enabled_agents:"},{"line_number":212,"context_line":"                self._cast_message("},{"line_number":213,"context_line":"                    context, method, payload, agent.host, agent.topic)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ffd0ebdf_4685e4ac","line":210,"updated":"2019-01-03 20:04:07.000000000","message":"So I have some more questions here.\n\n1) What happens when there is only one agent?  Should there even be a high priority message in that case?\n\n2) Have you tested this works in an environment that was exhibiting the problem?\n\n3) PORT_UPDATE_PRIORITY is lower than the one for networks, I\u0027m assuming that\u0027s because you want to always process the network before any updates to ports on it?  Just seemed like the comment was highlighting the port event.","commit_id":"d8a5186e1c9ac3ad1d408bd536dd270c8491adf9"},{"author":{"_account_id":28329,"name":"yangjianfeng","display_name":"JeffYang","email":"yjf1970231893@gmail.com","username":"yangjianfeng"},"change_message_id":"37a761527c3eaae0c875f019d965919f3594561a","unresolved":false,"context_lines":[{"line_number":207,"context_line":"                self._cast_message("},{"line_number":208,"context_line":"                    context, method, payload,"},{"line_number":209,"context_line":"                    high_agent.host, high_agent.topic)"},{"line_number":210,"context_line":"            payload[\u0027priority\u0027] \u003d OTHER_PRIORITY"},{"line_number":211,"context_line":"            for agent in enabled_agents:"},{"line_number":212,"context_line":"                self._cast_message("},{"line_number":213,"context_line":"                    context, method, payload, agent.host, agent.topic)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ffd0ebdf_157620da","line":210,"in_reply_to":"ffd0ebdf_4685e4ac","updated":"2019-01-04 02:11:06.000000000","message":"1、If there is only one agent, the classification for the port message is making no sense. All of the port message\u0027s priority is the same in the agent.\n2、The reproduction of this problem requires a larger environment. I tested this code in our quasi-production environment last week, but now I have no test permissions for this environment. I\u0027ll show an alternative test scheme later.\n3、Yes, I think the processing of the network should be before the port. These code\u0027s main goal is to improve the port\u0027s dhcp provisioning, and it could be difficult to understand, so I highlight the port event in the comment. But, I have no complete idea that how to classify other messages, for example, I want to allocate a higher priority for \u0027network_delete_end\u0027 and \u0027agent_updated\u0027 events, but I don\u0027t know if that is necessary, I may need further testing. So, if you have any suggestion about it, please tell me, Thanks. :_)","commit_id":"d8a5186e1c9ac3ad1d408bd536dd270c8491adf9"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c17d8558e76dae94085ce301c493a5382b336394","unresolved":false,"context_lines":[{"line_number":43,"context_line":"# port will not block other port\u0027s processing in other dhcp agents."},{"line_number":44,"context_line":"PRIORITY_PORT_UPDATE_HIGH \u003d 5"},{"line_number":45,"context_line":"PRIORITY_PORT_UPDATE_LOW \u003d 6"},{"line_number":46,"context_line":"PRIORITY_PORT_DELETE \u003d 7"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":12,"id":"bfdaf3ff_7909bbdb","line":46,"updated":"2019-01-10 21:31:21.000000000","message":"Do we need all these different priorities?  I\u0027m just asking for your opinion since in the l3-agent we just use 4.  Maybe it doesn\u0027t even matter...","commit_id":"9ad6b155e57a4fcbf86174ca847066707d698a33"},{"author":{"_account_id":28329,"name":"yangjianfeng","display_name":"JeffYang","email":"yjf1970231893@gmail.com","username":"yangjianfeng"},"change_message_id":"57423b3ce2f577b8f9114bc64e1c16c085aa1fc4","unresolved":false,"context_lines":[{"line_number":43,"context_line":"# port will not block other port\u0027s processing in other dhcp agents."},{"line_number":44,"context_line":"PRIORITY_PORT_UPDATE_HIGH \u003d 5"},{"line_number":45,"context_line":"PRIORITY_PORT_UPDATE_LOW \u003d 6"},{"line_number":46,"context_line":"PRIORITY_PORT_DELETE \u003d 7"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":12,"id":"bfdaf3ff_e65ba62b","line":46,"in_reply_to":"bfdaf3ff_7909bbdb","updated":"2019-01-13 04:43:02.000000000","message":"First, I think the parent resource should have a higher priority. In this way, we can skip some redundant process in agent side. For example, If a network was deleted, which ports have not yet been processed that belong to the network can be skipped.\nSecond, associate one priority to multiple methods, as I did before, I just think it is a bit obscure.","commit_id":"9ad6b155e57a4fcbf86174ca847066707d698a33"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c17d8558e76dae94085ce301c493a5382b336394","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            payload[\u0027priority\u0027] \u003d PRIORITY_NETWORK_DELETE"},{"line_number":181,"context_line":"        elif method \u003d\u003d \u0027port_delete_end\u0027:"},{"line_number":182,"context_line":"            payload[\u0027priority\u0027] \u003d PRIORITY_PORT_DELETE"},{"line_number":183,"context_line":"        return payload"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":186,"context_line":"        \"\"\"Notify all the agents that are hosting the network.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"bfdaf3ff_d9f787d4","line":183,"updated":"2019-01-10 21:31:21.000000000","message":"nit: guess you could have used a dict for mapping method to priority.","commit_id":"9ad6b155e57a4fcbf86174ca847066707d698a33"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c17d8558e76dae94085ce301c493a5382b336394","unresolved":false,"context_lines":[{"line_number":185,"context_line":"    def _notify_agents(self, context, method, payload, network_id):"},{"line_number":186,"context_line":"        \"\"\"Notify all the agents that are hosting the network.\"\"\""},{"line_number":187,"context_line":"        # fanout is required as we do not know who is \"listening\""},{"line_number":188,"context_line":"        payload \u003d self._assign_priority(method, payload)"},{"line_number":189,"context_line":"        no_agents \u003d not extensions.is_extension_supported("},{"line_number":190,"context_line":"            self.plugin, constants.DHCP_AGENT_SCHEDULER_EXT_ALIAS)"},{"line_number":191,"context_line":"        fanout_required \u003d method \u003d\u003d \u0027network_delete_end\u0027 or no_agents"}],"source_content_type":"text/x-python","patch_set":12,"id":"bfdaf3ff_392c9346","line":188,"updated":"2019-01-10 21:31:21.000000000","message":"nit: does it need to return payload?  it is just adding priority key/value to it.","commit_id":"9ad6b155e57a4fcbf86174ca847066707d698a33"},{"author":{"_account_id":28329,"name":"yangjianfeng","display_name":"JeffYang","email":"yjf1970231893@gmail.com","username":"yangjianfeng"},"change_message_id":"4ec7ee11f0621c96dca6ce8e907a3070d5f193b6","unresolved":false,"context_lines":[{"line_number":228,"context_line":"                    random.randint(0, len(enabled_agents) - 1))"},{"line_number":229,"context_line":"                payload[\u0027priority\u0027] \u003d PRIORITY_PORT_UPDATE_HIGH"},{"line_number":230,"context_line":"                self._cast_message("},{"line_number":231,"context_line":"                    context, method, copy.deepcopy(payload),"},{"line_number":232,"context_line":"                    high_agent.host, high_agent.topic)"},{"line_number":233,"context_line":"                payload[\u0027priority\u0027] \u003d PRIORITY_PORT_UPDATE_LOW"},{"line_number":234,"context_line":"            for agent in enabled_agents:"}],"source_content_type":"text/x-python","patch_set":12,"id":"dfd5e7cf_76120a5b","line":231,"range":{"start_line":231,"start_character":37,"end_line":231,"end_character":50},"updated":"2019-01-08 06:41:15.000000000","message":"Just for more easily write unit test. Because the mock only record the reference of the parameter. So, if I change the parameter after, This record of mock will also change.","commit_id":"9ad6b155e57a4fcbf86174ca847066707d698a33"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"251c43a5dbe1beea2748a8037514102eac4a827f","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    \u0027subnet_create_end\u0027: PRIORITY_SUBNET_UPDATE,"},{"line_number":55,"context_line":"    \u0027subnet_update_end\u0027: PRIORITY_SUBNET_UPDATE,"},{"line_number":56,"context_line":"    \u0027subnet_delete_end\u0027: PRIORITY_SUBNET_DELETE,"},{"line_number":57,"context_line":"    \u0027port_create_end\u0027: PRIORITY_PORT_CREATE_HIGH,"},{"line_number":58,"context_line":"    \u0027port_update_end\u0027: PRIORITY_PORT_UPDATE,"},{"line_number":59,"context_line":"    \u0027port_delete_end\u0027: PRIORITY_PORT_DELETE"},{"line_number":60,"context_line":"}"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_aa66a728","line":57,"updated":"2019-01-23 08:58:28.000000000","message":"I think that default value should be LOW priority","commit_id":"9482ce15b0aade2b859ce303947a1b08d2076b47"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"251c43a5dbe1beea2748a8037514102eac4a827f","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            if method \u003d\u003d \u0027port_create_end\u0027:"},{"line_number":224,"context_line":"                high_agent \u003d enabled_agents.pop("},{"line_number":225,"context_line":"                    random.randint(0, len(enabled_agents) - 1))"},{"line_number":226,"context_line":"                payload[\u0027priority\u0027] \u003d PRIORITY_PORT_CREATE_HIGH"},{"line_number":227,"context_line":"                self._cast_message("},{"line_number":228,"context_line":"                    context, method, copy.deepcopy(payload),"},{"line_number":229,"context_line":"                    high_agent.host, high_agent.topic)"},{"line_number":230,"context_line":"                payload[\u0027priority\u0027] \u003d PRIORITY_PORT_CREATE_LOW"},{"line_number":231,"context_line":"            for agent in enabled_agents:"},{"line_number":232,"context_line":"                self._cast_message("}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_4a3b7bea","line":229,"range":{"start_line":226,"start_character":16,"end_line":229,"end_character":54},"updated":"2019-01-23 08:58:28.000000000","message":"This could be moved to separate method. And if default priority for port_create_end will be this LOW value it may looks something like:\n\n    if method \u003d\u003d \u0027port_create_end\u0027:\n        high_agent \u003d enabled_agents.pop(\n                    random.randint(0, len(enabled_agents) - 1))\n        self._notify_high_priority_agent(context, payload, high_agent)\n\nThen in this new method:\n\n    def notify_high_priority_agent(context, payload, agent):\n        payload[\u0027priority\u0027] \u003d PRIORITY_PORT_CREATE_HIGH\n        self._cast_message(\n            context, \"port_create_end\", payload, agent.host, agent.topic)","commit_id":"9482ce15b0aade2b859ce303947a1b08d2076b47"},{"author":{"_account_id":28329,"name":"yangjianfeng","display_name":"JeffYang","email":"yjf1970231893@gmail.com","username":"yangjianfeng"},"change_message_id":"78853972844ad54731c42acd1d5fa0177bc4b3a7","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            if method \u003d\u003d \u0027port_create_end\u0027:"},{"line_number":224,"context_line":"                high_agent \u003d enabled_agents.pop("},{"line_number":225,"context_line":"                    random.randint(0, len(enabled_agents) - 1))"},{"line_number":226,"context_line":"                payload[\u0027priority\u0027] \u003d PRIORITY_PORT_CREATE_HIGH"},{"line_number":227,"context_line":"                self._cast_message("},{"line_number":228,"context_line":"                    context, method, copy.deepcopy(payload),"},{"line_number":229,"context_line":"                    high_agent.host, high_agent.topic)"},{"line_number":230,"context_line":"                payload[\u0027priority\u0027] \u003d PRIORITY_PORT_CREATE_LOW"},{"line_number":231,"context_line":"            for agent in enabled_agents:"},{"line_number":232,"context_line":"                self._cast_message("}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_02f46ace","line":229,"range":{"start_line":226,"start_character":16,"end_line":229,"end_character":54},"in_reply_to":"9fdfeff1_4a3b7bea","updated":"2019-01-24 01:15:14.000000000","message":"Good suggestion, Thanks.","commit_id":"9482ce15b0aade2b859ce303947a1b08d2076b47"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"3a5d7890e8f56096b6a94866997c7bc725ceb95a","unresolved":false,"context_lines":[{"line_number":229,"context_line":"                self._cast_message("},{"line_number":230,"context_line":"                    context, method, payload, agent.host, agent.topic)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def _notify_high_priority_agent(self, context, payload, high_agent):"},{"line_number":233,"context_line":"        payload[\u0027priority\u0027] \u003d PRIORITY_PORT_CREATE_HIGH"},{"line_number":234,"context_line":"        self._cast_message(context, \"port_create_end\","},{"line_number":235,"context_line":"                           payload, high_agent.host, high_agent.topic)"}],"source_content_type":"text/x-python","patch_set":19,"id":"9fdfeff1_42b82d75","line":232,"range":{"start_line":232,"start_character":60,"end_line":232,"end_character":70},"updated":"2019-01-24 08:45:39.000000000","message":"nit: IMO here \"agent\" would be better as name","commit_id":"95b2df66a3adca788912849ab8876a5a1fcb6e01"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"82bf25ebd1cdfbc7b1286a97e3ab9727723517d2","unresolved":false,"context_lines":[{"line_number":229,"context_line":"                self._cast_message("},{"line_number":230,"context_line":"                    context, method, payload, agent.host, agent.topic)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def _notify_high_priority_agent(self, context, payload, agent):"},{"line_number":233,"context_line":"        payload[\u0027priority\u0027] \u003d PRIORITY_PORT_CREATE_HIGH"},{"line_number":234,"context_line":"        self._cast_message(context, \"port_create_end\","},{"line_number":235,"context_line":"                           payload, agent.host, agent.topic)"}],"source_content_type":"text/x-python","patch_set":21,"id":"9fdfeff1_da14c246","line":232,"updated":"2019-01-28 19:09:53.000000000","message":"nit: The name of this method doesn\u0027t fit the code, which only sends a port_create_end, but it\u0027s a nit.","commit_id":"99f4495c940011293e3cabbb590770dc1e7b6900"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"a720ebf80baa1270a99429562a0e0138c8fe2c33","unresolved":false,"context_lines":[{"line_number":229,"context_line":"                self._cast_message("},{"line_number":230,"context_line":"                    context, method, payload, agent.host, agent.topic)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"    def _notify_high_priority_agent(self, context, payload, agent):"},{"line_number":233,"context_line":"        payload[\u0027priority\u0027] \u003d PRIORITY_PORT_CREATE_HIGH"},{"line_number":234,"context_line":"        self._cast_message(context, \"port_create_end\","},{"line_number":235,"context_line":"                           payload, agent.host, agent.topic)"}],"source_content_type":"text/x-python","patch_set":21,"id":"9fdfeff1_f0cf6753","line":232,"in_reply_to":"9fdfeff1_da14c246","updated":"2019-01-28 21:47:32.000000000","message":"I think it\u0027s fine. Method from this one is called is named \"_notify_agents\" and this is doing the same but only for one \"kind\" of agents and one type of event. I\u0027m not sure if we should put too many details in name of the method :)","commit_id":"99f4495c940011293e3cabbb590770dc1e7b6900"}],"neutron/tests/unit/api/rpc/agentnotifiers/test_dhcp_rpc_agent_api.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c17d8558e76dae94085ce301c493a5382b336394","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    \u0027subnet_delete_end\u0027: PRIORITY_SUBNET_DELETE,"},{"line_number":49,"context_line":"    \u0027port_create_end\u0027: PRIORITY_PORT_UPDATE_LOW,"},{"line_number":50,"context_line":"    \u0027port_update_end\u0027: PRIORITY_PORT_UPDATE_LOW,"},{"line_number":51,"context_line":"    \u0027port_delete_end\u0027: PRIORITY_PORT_DELETE"},{"line_number":52,"context_line":"}"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"bfdaf3ff_b973a34d","line":51,"updated":"2019-01-10 21:31:21.000000000","message":"You used a dict here :)","commit_id":"9ad6b155e57a4fcbf86174ca847066707d698a33"}],"neutron/tests/unit/db/test_agentschedulers_db.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"79d7744dda6836dd94b93124c8a8066bd805c83b","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"OTHER_PRIORITY \u003d 2"},{"line_number":56,"context_line":"PORT_UPDATE_PRIORITY \u003d 1"},{"line_number":57,"context_line":"NETWORK_CREATE_PRIORITY \u003d 0"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"DEVICE_OWNER_COMPUTE \u003d \u0027\u0027.join([constants.DEVICE_OWNER_COMPUTE_PREFIX,"},{"line_number":60,"context_line":"                                \u0027test:\u0027,"}],"source_content_type":"text/x-python","patch_set":9,"id":"ffd0ebdf_a6629015","line":57,"updated":"2019-01-03 20:04:07.000000000","message":"nit: 0 -\u003e 2","commit_id":"d8a5186e1c9ac3ad1d408bd536dd270c8491adf9"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"251c43a5dbe1beea2748a8037514102eac4a827f","unresolved":false,"context_lines":[{"line_number":58,"context_line":"PRIORITY_NETWORK_DELETE \u003d 2"},{"line_number":59,"context_line":"PRIORITY_SUBNET_UPDATE \u003d 3"},{"line_number":60,"context_line":"PRIORITY_PORT_CREATE_HIGH \u003d 5"},{"line_number":61,"context_line":"PRIORITY_PORT_CREATE_LOW \u003d 6"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"DEVICE_OWNER_COMPUTE \u003d \u0027\u0027.join([constants.DEVICE_OWNER_COMPUTE_PREFIX,"},{"line_number":64,"context_line":"                                \u0027test:\u0027,"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_0a0ed33a","line":61,"updated":"2019-01-23 08:58:28.000000000","message":"why You didn\u0027t reused values from neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py ?","commit_id":"9482ce15b0aade2b859ce303947a1b08d2076b47"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"82bf25ebd1cdfbc7b1286a97e3ab9727723517d2","unresolved":false,"context_lines":[{"line_number":48,"context_line":"from neutron.tests.unit import testlib_api"},{"line_number":49,"context_line":"from neutron import wsgi"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"L3_HOSTA \u003d \u0027hosta\u0027"},{"line_number":53,"context_line":"DHCP_HOSTA \u003d \u0027hosta\u0027"},{"line_number":54,"context_line":"L3_HOSTB \u003d \u0027hostb\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"9fdfeff1_ba30dee9","line":51,"updated":"2019-01-28 19:09:53.000000000","message":"nit: whitespace change","commit_id":"99f4495c940011293e3cabbb590770dc1e7b6900"}]}
