)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c2c61b37c11dd2be26b76f6b5e50ff6073826068","unresolved":false,"context_lines":[{"line_number":13,"context_line":"HA ports are handled well in l3 agent side."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: Ie38baf061d678fc5d768195b25241efbad74e42f"},{"line_number":16,"context_line":"Closes-Bug: #1523780"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da6ed579_b7fe9836","line":16,"range":{"start_line":16,"start_character":13,"end_line":16,"end_character":20},"updated":"2016-01-12 23:02:36.000000000","message":"I\u0027ve got a bunch of reviews that claim to close the same bug [1-7].  In general, we can only have one review close a bug.  If it needs other patches then it needs to depend on them and then wait for them all to get merged and then close the bug.\n\nAs it is now, the first one of these to merge will close the bug and then we\u0027ll be reviewing the rest on a bug marked closed.  Something needs to be done.  Here are some options.\n\n1.  You could line them all up properly with most of them marked with related-bug instead of closes-bug with the last one coming in a closing it.\n2.  You could keep them independent and file a bug for each independent fix.\n3.  Some mix of 1 and 2.\n4.  Tell me that they are all independent fixes for the same bug and which one is the best one to review (probably abandon most of the others).\n\n[1] https://review.openstack.org/#/c/265672/\n[2] https://review.openstack.org/#/c/265676/\n[3] https://review.openstack.org/#/c/265680/\n[4] https://review.openstack.org/#/c/265682/\n[5] https://review.openstack.org/#/c/265685/\n[6] https://review.openstack.org/#/c/266109/\n[7] https://review.openstack.org/#/c/260303/","commit_id":"49e557db70349b3ff648198d2785164cb10643d1"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"6a66b5424f40d30131590d3b9913bd06061e1601","unresolved":false,"context_lines":[{"line_number":13,"context_line":"HA ports are handled well in l3 agent side."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: Ie38baf061d678fc5d768195b25241efbad74e42f"},{"line_number":16,"context_line":"Closes-Bug: #1523780"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da6ed579_daac8c37","line":16,"range":{"start_line":16,"start_character":13,"end_line":16,"end_character":20},"in_reply_to":"da6ed579_b7fe9836","updated":"2016-01-13 02:15:13.000000000","message":"Thank you, as Kevin Benton mentioned in Patch Set 10 https://review.openstack.org/#/c/260303/10:\n\"to elaborate, the commit message identifies 4 different race conditions. please fix one in each patch so it\u0027s clear what is being done\". Different people have different views, so now each patch deal with each one race.\nMaybe I should register a separated lp bug for each patch.","commit_id":"49e557db70349b3ff648198d2785164cb10643d1"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"a098abee44fb99c110c7276991b331696b36f12d","unresolved":false,"context_lines":[{"line_number":13,"context_line":"HA ports are handled well in l3 agent side."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: Ie38baf061d678fc5d768195b25241efbad74e42f"},{"line_number":16,"context_line":"Closes-Bug: #1523780"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da6ed579_d369d726","line":16,"range":{"start_line":16,"start_character":13,"end_line":16,"end_character":20},"in_reply_to":"da6ed579_daac8c37","updated":"2016-01-13 03:30:12.000000000","message":"New LP bug #1533457","commit_id":"49e557db70349b3ff648198d2785164cb10643d1"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"072b3c17a3f60b8ea3bbf5017fbdb5eea6266312","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Neutron server will not be able to sync ha router data after"},{"line_number":10,"context_line":"race happened beteen get_ha_router_port_bindings and HA router"},{"line_number":11,"context_line":"deleting API call."},{"line_number":12,"context_line":"This patch make it runing properly, since HA routers without"},{"line_number":13,"context_line":"HA ports are handled well in l3 agent side."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: Ie38baf061d678fc5d768195b25241efbad74e42f"},{"line_number":16,"context_line":"Closes-Bug: #1533457"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"bae84128_2124485e","line":13,"range":{"start_line":12,"start_character":36,"end_line":13,"end_character":43},"updated":"2016-02-23 13:42:30.000000000","message":"Actually, according to the current code [1], in the case of, for example, sync_routers returned a router with no HA_INTERFACE_KEY, the code at [1] will return immediately and self._init_keepalived_manager() would not be invoked. Later on, [2] will be invoked and the code will fail because self.keepalived_manager \u003d\u003d None, causing the router info to not be constructed properly.\n\n[1]: https://github.com/openstack/neutron/blob/dbd0ec757a0e6c45fe873be7a1f206cc54ee75eb/neutron/agent/l3/ha_router.py#L80\n[2]: https://github.com/openstack/neutron/blob/dbd0ec757a0e6c45fe873be7a1f206cc54ee75eb/neutron/agent/l3/ha_router.py#L220","commit_id":"a6c19f4d69227f39bed02ab3dd841e0a5d8ec726"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"35f8ef7a33c6382f21afe454bd978103ca571198","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Neutron server will not be able to sync ha router data after"},{"line_number":10,"context_line":"race happened beteen get_ha_router_port_bindings and HA router"},{"line_number":11,"context_line":"deleting API call."},{"line_number":12,"context_line":"This patch make it runing properly, since HA routers without"},{"line_number":13,"context_line":"HA ports are handled well in l3 agent side."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: Ie38baf061d678fc5d768195b25241efbad74e42f"},{"line_number":16,"context_line":"Closes-Bug: #1533457"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"bae84128_47fb59c1","line":13,"range":{"start_line":12,"start_character":36,"end_line":13,"end_character":43},"in_reply_to":"bae84128_0c5df846","updated":"2016-02-23 14:32:24.000000000","message":"If this is the case, this patch should be made dependent on it.\nAlso, if it was handled there, can you clarify what this patch fixes that that one doesn\u0027t?","commit_id":"a6c19f4d69227f39bed02ab3dd841e0a5d8ec726"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"840f6dc150f48254218417c2eec8a459754ce4a9","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Neutron server will not be able to sync ha router data after"},{"line_number":10,"context_line":"race happened beteen get_ha_router_port_bindings and HA router"},{"line_number":11,"context_line":"deleting API call."},{"line_number":12,"context_line":"This patch make it runing properly, since HA routers without"},{"line_number":13,"context_line":"HA ports are handled well in l3 agent side."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: Ie38baf061d678fc5d768195b25241efbad74e42f"},{"line_number":16,"context_line":"Closes-Bug: #1533457"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"bae84128_0c5df846","line":13,"range":{"start_line":12,"start_character":36,"end_line":13,"end_character":43},"in_reply_to":"bae84128_2124485e","updated":"2016-02-23 14:28:21.000000000","message":"That was handled here:\nhttps://review.openstack.org/#/c/265672/","commit_id":"a6c19f4d69227f39bed02ab3dd841e0a5d8ec726"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"3fcdd4d19fbbaa67fb86e6a9e6e0ba8b703f6598","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Neutron server will not be able to sync ha router data after"},{"line_number":10,"context_line":"race happened beteen get_ha_router_port_bindings and HA router"},{"line_number":11,"context_line":"deleting API call."},{"line_number":12,"context_line":"This patch make it runing properly, since HA routers without"},{"line_number":13,"context_line":"HA ports are handled well in l3 agent side."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: Ie38baf061d678fc5d768195b25241efbad74e42f"},{"line_number":16,"context_line":"Closes-Bug: #1533457"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"bae84128_82ef0fe8","line":13,"range":{"start_line":12,"start_character":36,"end_line":13,"end_character":43},"in_reply_to":"bae84128_47fb59c1","updated":"2016-02-23 14:54:41.000000000","message":"Oh, it\u0027s a long story, originally all the race condition was handled in patch 260303 where we just discussed there. But some code reviewer want me to separate the patch for each race.\nFor more information you can go to LP bug #1523780 to see the origin issue. Thanks.","commit_id":"a6c19f4d69227f39bed02ab3dd841e0a5d8ec726"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"ce62633ca3aa567c1c48af0b8289300697431814","unresolved":false,"context_lines":[{"line_number":15,"context_line":"filter the bindings without port."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: Ie38baf061d678fc5d768195b25241efbad74e42f"},{"line_number":18,"context_line":"Closes-Bug: #1533457"},{"line_number":19,"context_line":"Closes-Bug: #1605546"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"bacf61ea_64e8a37d","line":19,"range":{"start_line":18,"start_character":0,"end_line":19,"end_character":20},"updated":"2016-07-28 08:45:15.000000000","message":"These are practically the same bug (the later is a duplicate of the former). If you respin, the second one can be removed, but it\u0027s not something that will hold this patch up.","commit_id":"1650d764779fbb4fa7c44095222fd6f151093b93"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2711f30a17632f605f893df927e16f6ba5a905a1","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Filter HA router without HA port bindings after race conditions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Neutron server will not be able to sync ha router data after"},{"line_number":10,"context_line":"race happened beteen get_ha_router_port_bindings and HA router"},{"line_number":11,"context_line":"deleting API call. Once the ports of L3HARouterAgentPortBinding"},{"line_number":12,"context_line":"were deleted the _process_sync_ha_data may get a None binding"},{"line_number":13,"context_line":"port, and then the _process_sync_ha_data will fail to get the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":21,"id":"bacf61ea_9f8fc7cb","line":10,"range":{"start_line":10,"start_character":14,"end_line":10,"end_character":20},"updated":"2016-07-28 15:44:24.000000000","message":"between","commit_id":"5846da38adaadaa2b638e7f1cfe44c1df34b37cc"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"a52960a5f0a7ac33ecb835f29e8dd58295d6ebaa","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Filter HA router without HA port bindings after race conditions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Neutron server will not be able to sync ha router data after"},{"line_number":10,"context_line":"race happened beteen get_ha_router_port_bindings and HA router"},{"line_number":11,"context_line":"deleting API call. Once the ports of L3HARouterAgentPortBinding"},{"line_number":12,"context_line":"were deleted the _process_sync_ha_data may get a None binding"},{"line_number":13,"context_line":"port, and then the _process_sync_ha_data will fail to get the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":21,"id":"bacf61ea_ff150e49","line":10,"range":{"start_line":10,"start_character":14,"end_line":10,"end_character":20},"in_reply_to":"bacf61ea_9f8fc7cb","updated":"2016-07-28 23:02:38.000000000","message":"Done","commit_id":"5846da38adaadaa2b638e7f1cfe44c1df34b37cc"}],"neutron/db/l3_hamode_db.py":[{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"a31e2efb6b779581527484a55d197d6bc128fd64","unresolved":false,"context_lines":[{"line_number":576,"context_line":"                                                    host)"},{"line_number":577,"context_line":"        for binding in bindings:"},{"line_number":578,"context_line":"            router \u003d routers_dict.get(binding.router_id)"},{"line_number":579,"context_line":"            if binding.port:"},{"line_number":580,"context_line":"                port_dict \u003d self._core_plugin._make_port_dict(binding.port)"},{"line_number":581,"context_line":"                router[constants.HA_INTERFACE_KEY] \u003d port_dict"},{"line_number":582,"context_line":"            if binding.state:"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_09a1e045","line":579,"range":{"start_line":579,"start_character":12,"end_line":579,"end_character":28},"updated":"2016-01-15 13:13:51.000000000","message":"If we do not have this information here, are sure that we can proceed further?","commit_id":"898f8e2d987640d8bbee5ec7fc9476f9739fb35c"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"83f688f9f63f9faa8b8cfcda7fccd4895f701ef0","unresolved":false,"context_lines":[{"line_number":576,"context_line":"                                                    host)"},{"line_number":577,"context_line":"        for binding in bindings:"},{"line_number":578,"context_line":"            router \u003d routers_dict.get(binding.router_id)"},{"line_number":579,"context_line":"            if binding.port:"},{"line_number":580,"context_line":"                port_dict \u003d self._core_plugin._make_port_dict(binding.port)"},{"line_number":581,"context_line":"                router[constants.HA_INTERFACE_KEY] \u003d port_dict"},{"line_number":582,"context_line":"            if binding.state:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a5de9d1_4ccef384","line":579,"range":{"start_line":579,"start_character":12,"end_line":579,"end_character":28},"in_reply_to":"da6ed579_09a1e045","updated":"2016-01-27 10:17:36.000000000","message":"In the normal procedure the binding must have the port. But in the race scenario, such as create_and_delete_routers which we\u0027re discussing for a long time, binding may have no port, or the \nbinding\u0027s ports are deleted concurrently. I\u0027ve submit a series of patch to ensure that if there is a \u0027deleting\u0027 API/RPC call, let both neutron server and l3 agent could clean up all the router\u0027s stuffs. So here just let it pass and go further to next delete step.","commit_id":"898f8e2d987640d8bbee5ec7fc9476f9739fb35c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ab19753901f9c331d7eb0f4d1c09867b617a5cb8","unresolved":false,"context_lines":[{"line_number":622,"context_line":"    def _process_sync_ha_data(self, context, routers, host):"},{"line_number":623,"context_line":"        routers_dict \u003d dict((router[\u0027id\u0027], router) for router in routers)"},{"line_number":624,"context_line":""},{"line_number":625,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":626,"context_line":"                                                    routers_dict.keys(),"},{"line_number":627,"context_line":"                                                    host)"},{"line_number":628,"context_line":"        for binding in bindings:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_2ca93fe0","line":625,"updated":"2016-02-26 16:06:22.000000000","message":"just adjust get_ha_router_port_bindings to enable eagerloading on the port relationship. Then callers don\u0027t have to check that the port still exists. On the query just put .options(joinedload(\u0027port\u0027)).","commit_id":"87b23b5956e5b011a712275a722d0f05f92bd1d6"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4fcb0e43cf1fba63370e26e081b8bfda22d247cc","unresolved":false,"context_lines":[{"line_number":622,"context_line":"    def _process_sync_ha_data(self, context, routers, host):"},{"line_number":623,"context_line":"        routers_dict \u003d dict((router[\u0027id\u0027], router) for router in routers)"},{"line_number":624,"context_line":""},{"line_number":625,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":626,"context_line":"                                                    routers_dict.keys(),"},{"line_number":627,"context_line":"                                                    host)"},{"line_number":628,"context_line":"        for binding in bindings:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_f6854aad","line":625,"in_reply_to":"9aed3d3a_2ca93fe0","updated":"2016-02-27 02:06:51.000000000","message":"Done","commit_id":"87b23b5956e5b011a712275a722d0f05f92bd1d6"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"ab19753901f9c331d7eb0f4d1c09867b617a5cb8","unresolved":false,"context_lines":[{"line_number":630,"context_line":"            if binding.port:"},{"line_number":631,"context_line":"                port_dict \u003d self._core_plugin._make_port_dict(binding.port)"},{"line_number":632,"context_line":"                router[constants.HA_INTERFACE_KEY] \u003d port_dict"},{"line_number":633,"context_line":"            if binding.state:"},{"line_number":634,"context_line":"                router[constants.HA_ROUTER_STATE_KEY] \u003d binding.state"},{"line_number":635,"context_line":""},{"line_number":636,"context_line":"        for router in routers_dict.values():"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_8cb04b45","line":633,"updated":"2016-02-26 16:06:22.000000000","message":"It shouln\u0027t be possible for \u0027state\u0027 to be None since state is part of the record.","commit_id":"87b23b5956e5b011a712275a722d0f05f92bd1d6"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"4fcb0e43cf1fba63370e26e081b8bfda22d247cc","unresolved":false,"context_lines":[{"line_number":630,"context_line":"            if binding.port:"},{"line_number":631,"context_line":"                port_dict \u003d self._core_plugin._make_port_dict(binding.port)"},{"line_number":632,"context_line":"                router[constants.HA_INTERFACE_KEY] \u003d port_dict"},{"line_number":633,"context_line":"            if binding.state:"},{"line_number":634,"context_line":"                router[constants.HA_ROUTER_STATE_KEY] \u003d binding.state"},{"line_number":635,"context_line":""},{"line_number":636,"context_line":"        for router in routers_dict.values():"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_569516dc","line":633,"in_reply_to":"9aed3d3a_8cb04b45","updated":"2016-02-27 02:06:51.000000000","message":"Done","commit_id":"87b23b5956e5b011a712275a722d0f05f92bd1d6"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"4a3629894d88783398e914b679b445dd4b255904","unresolved":false,"context_lines":[{"line_number":650,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":651,"context_line":"                                                    routers_dict.keys(),"},{"line_number":652,"context_line":"                                                    host)"},{"line_number":653,"context_line":"        for binding in bindings:"},{"line_number":654,"context_line":"            router \u003d routers_dict.get(binding.router_id)"},{"line_number":655,"context_line":"            if binding.port:"},{"line_number":656,"context_line":"                port_dict \u003d self._core_plugin._make_port_dict(binding.port)"}],"source_content_type":"text/x-python","patch_set":12,"id":"da0c15f0_eb5f0b3f","line":653,"updated":"2016-03-28 14:45:43.000000000","message":"If router is deleted(from DB) after L650, then we shouldn\u0027t return this router as part of routers, so that agent won\u0027t get information about this deleted router.\nI think this patch needs further cleanup of deleted router from routers.","commit_id":"83729cca7b30a6d8c937e51fd4cc74e013782e03"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"73a39e2e1e4633108436a32da5a5d16285806d17","unresolved":false,"context_lines":[{"line_number":650,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":651,"context_line":"                                                    routers_dict.keys(),"},{"line_number":652,"context_line":"                                                    host)"},{"line_number":653,"context_line":"        for binding in bindings:"},{"line_number":654,"context_line":"            router \u003d routers_dict.get(binding.router_id)"},{"line_number":655,"context_line":"            if binding.port:"},{"line_number":656,"context_line":"                port_dict \u003d self._core_plugin._make_port_dict(binding.port)"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_186a051b","line":653,"in_reply_to":"da0c15f0_8e101daa","updated":"2016-03-28 15:35:02.000000000","message":"Thanks LIU. I missed L666.\nBut what if router is deleted after line 655 and before 656. In this case, when rpc worker is executing L656, we still get exception right?\nWhy can\u0027t we have L656-657 in try block?","commit_id":"83729cca7b30a6d8c937e51fd4cc74e013782e03"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"45111c6258909275de1e4078b97ca62967e2954a","unresolved":false,"context_lines":[{"line_number":650,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":651,"context_line":"                                                    routers_dict.keys(),"},{"line_number":652,"context_line":"                                                    host)"},{"line_number":653,"context_line":"        for binding in bindings:"},{"line_number":654,"context_line":"            router \u003d routers_dict.get(binding.router_id)"},{"line_number":655,"context_line":"            if binding.port:"},{"line_number":656,"context_line":"                port_dict \u003d self._core_plugin._make_port_dict(binding.port)"}],"source_content_type":"text/x-python","patch_set":12,"id":"da0c15f0_8e101daa","line":653,"in_reply_to":"da0c15f0_eb5f0b3f","updated":"2016-03-28 14:59:45.000000000","message":"I don\u0027t understand what\u0027s your point.\nL666 will filter the HA router without HA interface if HA router was deleted concurrently.\nIf the l3 agent could not sync the router info, the agent will go to the router_remove procedure.\nAnd what\u0027s the \"cleanup of deleted router from routers\" ? in neutron server? or in l3 agent?","commit_id":"83729cca7b30a6d8c937e51fd4cc74e013782e03"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"98496a5a6a875041a62a3d45b03689d7f3a8ea5a","unresolved":false,"context_lines":[{"line_number":652,"context_line":"                                                    host)"},{"line_number":653,"context_line":"        for binding in bindings:"},{"line_number":654,"context_line":"            router \u003d routers_dict.get(binding.router_id)"},{"line_number":655,"context_line":"            if binding.port:"},{"line_number":656,"context_line":"                port_dict \u003d self._core_plugin._make_port_dict(binding.port)"},{"line_number":657,"context_line":"                router[constants.HA_INTERFACE_KEY] \u003d port_dict"},{"line_number":658,"context_line":"            router[constants.HA_ROUTER_STATE_KEY] \u003d binding.state"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_48300b57","line":655,"updated":"2016-03-29 09:15:04.000000000","message":"Because of L590, if binding exist then binding.port is always True. So I think you can remove the check \"if binding.port:\" in L655.\nWith this patch, if port is deleted after L650, we will be still adding the deleted port to router[constants.HA_INTERFACE_KEY]. \nIn alternate approach, you can catch the exception(if port is deleted before L657) and avoid adding the port to router and avoid returning this deleted HA router.","commit_id":"83729cca7b30a6d8c937e51fd4cc74e013782e03"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"f39017bcb2321a180830300fc33b4b4ed1d91aa9","unresolved":false,"context_lines":[{"line_number":652,"context_line":"                                                    host)"},{"line_number":653,"context_line":"        for binding in bindings:"},{"line_number":654,"context_line":"            router \u003d routers_dict.get(binding.router_id)"},{"line_number":655,"context_line":"            if binding.port:"},{"line_number":656,"context_line":"                port_dict \u003d self._core_plugin._make_port_dict(binding.port)"},{"line_number":657,"context_line":"                router[constants.HA_INTERFACE_KEY] \u003d port_dict"},{"line_number":658,"context_line":"            router[constants.HA_ROUTER_STATE_KEY] \u003d binding.state"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_a3a58805","line":655,"in_reply_to":"ba0121b8_48300b57","updated":"2016-03-29 09:22:15.000000000","message":"Thank you very much, I will remove this check, and catch the TypeError for the None port. The new patch is ready, I just do not submit it yet. : )","commit_id":"83729cca7b30a6d8c937e51fd4cc74e013782e03"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"631e5df5217c2371acea1a6069a8a61b5a86e6b7","unresolved":false,"context_lines":[{"line_number":606,"context_line":"            query \u003d query.join(agents_db.Agent).filter("},{"line_number":607,"context_line":"                agents_db.Agent.host \u003d\u003d host)"},{"line_number":608,"context_line":""},{"line_number":609,"context_line":"        query \u003d query.options(orm.joinedload(\u0027port\u0027)).filter("},{"line_number":610,"context_line":"            L3HARouterAgentPortBinding.router_id.in_(router_ids))"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"        return query.all()"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba0121b8_c9109d51","line":609,"updated":"2016-03-29 09:52:21.000000000","message":"Can you please remove change at L609? Because of this, you won\u0027t get exceptions if port is deleted after L669.","commit_id":"291c0c496373b1a5316f4775b0d825ecbd4f09ae"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"537fc260b18c5b2c51a0bfda280acce0aa7de635","unresolved":false,"context_lines":[{"line_number":606,"context_line":"            query \u003d query.join(agents_db.Agent).filter("},{"line_number":607,"context_line":"                agents_db.Agent.host \u003d\u003d host)"},{"line_number":608,"context_line":""},{"line_number":609,"context_line":"        query \u003d query.options(orm.joinedload(\u0027port\u0027)).filter("},{"line_number":610,"context_line":"            L3HARouterAgentPortBinding.router_id.in_(router_ids))"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"        return query.all()"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba0121b8_5bbbb072","line":609,"in_reply_to":"ba0121b8_9bac28ef","updated":"2016-03-29 10:30:02.000000000","message":"thanks","commit_id":"291c0c496373b1a5316f4775b0d825ecbd4f09ae"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"1da18865e632ed2903c2036d2343a7fe25f9b1ac","unresolved":false,"context_lines":[{"line_number":606,"context_line":"            query \u003d query.join(agents_db.Agent).filter("},{"line_number":607,"context_line":"                agents_db.Agent.host \u003d\u003d host)"},{"line_number":608,"context_line":""},{"line_number":609,"context_line":"        query \u003d query.options(orm.joinedload(\u0027port\u0027)).filter("},{"line_number":610,"context_line":"            L3HARouterAgentPortBinding.router_id.in_(router_ids))"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"        return query.all()"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba0121b8_9bac28ef","line":609,"in_reply_to":"ba0121b8_c9109d51","updated":"2016-03-29 10:12:18.000000000","message":"This is a filter for those router has no ha port. And the try-catch is for the race scenario between port_delete and router_info_sync you describe in patch set 12.","commit_id":"291c0c496373b1a5316f4775b0d825ecbd4f09ae"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"1bbed3d832b513bfc05fea78553ba9210acf348b","unresolved":false,"context_lines":[{"line_number":675,"context_line":"                port_dict \u003d self._core_plugin._make_port_dict(binding.port)"},{"line_number":676,"context_line":"                router[constants.HA_INTERFACE_KEY] \u003d port_dict"},{"line_number":677,"context_line":"            except TypeError:"},{"line_number":678,"context_line":"                LOG.debug(\"HA port was deleted by concurent operation\")"},{"line_number":679,"context_line":"            router[constants.HA_ROUTER_STATE_KEY] \u003d binding.state"},{"line_number":680,"context_line":""},{"line_number":681,"context_line":"        for router in routers_dict.values():"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a122d0e_2e901243","line":678,"range":{"start_line":678,"start_character":16,"end_line":678,"end_character":26},"updated":"2016-04-18 12:52:30.000000000","message":"I want to re-open the discussion that took place in PS #12, since the filter in like 687 has been removed in [1]. In this case we probably don\u0027t want to just ignore the error (sending a router_dict without the HA port to an l3 agent will produce pretty bad effects on the l3 agent (endless loops, etc).\n\nAnyhow, can this patch be rebased and re-checked that it still works post-[1]?\n\n[1]: https://review.openstack.org/#/c/257059/","commit_id":"291c0c496373b1a5316f4775b0d825ecbd4f09ae"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"17f8f93ba0d904cf792eb147894f758bc5f293fb","unresolved":false,"context_lines":[{"line_number":616,"context_line":"            query \u003d query.join(agents_db.Agent).filter("},{"line_number":617,"context_line":"                agents_db.Agent.host \u003d\u003d host)"},{"line_number":618,"context_line":""},{"line_number":619,"context_line":"        query \u003d query.options(orm.joinedload(\u0027port\u0027)).filter("},{"line_number":620,"context_line":"            L3HARouterAgentPortBinding.router_id.in_(router_ids))"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"        return query.all()"},{"line_number":623,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"1aa78d24_6e229da4","line":620,"range":{"start_line":619,"start_character":8,"end_line":620,"end_character":65},"updated":"2016-07-07 08:32:01.000000000","message":"@John Schwarz, the race between ha_port deletion and a HA router sync rpc.","commit_id":"8be9b1642ff4f5b44696b12e2b1799ef416542b9"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"468c75ac0d7837de8396b2d617c57fb5fff7747e","unresolved":false,"context_lines":[{"line_number":695,"context_line":"                        # Filter the HA router has no ha port here"},{"line_number":696,"context_line":"                        routers_dict.pop(binding.router_id)"},{"line_number":697,"context_line":"                        continue"},{"line_number":698,"context_line":"                    else:"},{"line_number":699,"context_line":"                        # For a single router sync RPC we raise the exception"},{"line_number":700,"context_line":"                        raise l3_ha.HARouterAgentPortBindingPortNotFound("},{"line_number":701,"context_line":"                            router_id\u003dbinding.router_id)"}],"source_content_type":"text/x-python","patch_set":18,"id":"bacf61ea_ed2c81ad","line":698,"updated":"2016-07-28 04:49:46.000000000","message":"this behavior makes no sense. we shouldn\u0027t be raising exceptions based on the length of the list. in one case we silently exlude it and in the error we trigger an exception that goes back to the agent.\n\nIn both cases we should just hide the router.","commit_id":"f9344ca2c9f71dd43a51a8277771eba621b54278"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"9aa58aa9bd4b6eb11610189e7bbeaa13fdc10f50","unresolved":false,"context_lines":[{"line_number":695,"context_line":"                        # Filter the HA router has no ha port here"},{"line_number":696,"context_line":"                        routers_dict.pop(binding.router_id)"},{"line_number":697,"context_line":"                        continue"},{"line_number":698,"context_line":"                    else:"},{"line_number":699,"context_line":"                        # For a single router sync RPC we raise the exception"},{"line_number":700,"context_line":"                        raise l3_ha.HARouterAgentPortBindingPortNotFound("},{"line_number":701,"context_line":"                            router_id\u003dbinding.router_id)"}],"source_content_type":"text/x-python","patch_set":18,"id":"bacf61ea_b8092534","line":698,"in_reply_to":"bacf61ea_ed2c81ad","updated":"2016-07-28 05:31:17.000000000","message":"Done","commit_id":"f9344ca2c9f71dd43a51a8277771eba621b54278"},{"author":{"_account_id":12860,"name":"Dongcan Ye","email":"yedongcan@yeah.net","username":"yedongcan"},"change_message_id":"a1161ce92c516458ac49e609071226fbf65062f2","unresolved":false,"context_lines":[{"line_number":706,"context_line":"            if interface:"},{"line_number":707,"context_line":"                self._populate_mtu_and_subnets_for_ports(context, [interface])"},{"line_number":708,"context_line":""},{"line_number":709,"context_line":"        # Could not filter the HA_INTERFACE_KEY here, because a DVR router"},{"line_number":710,"context_line":"        # with SNAT HA in DVR compute host also does not have that attribute."},{"line_number":711,"context_line":"        return list(routers_dict.values())"},{"line_number":712,"context_line":""},{"line_number":713,"context_line":"    @log_helpers.log_method_call"}],"source_content_type":"text/x-python","patch_set":18,"id":"bacf61ea_adad6933","line":710,"range":{"start_line":709,"start_character":64,"end_line":710,"end_character":42},"updated":"2016-07-28 05:03:07.000000000","message":"Just a minor question here, should it \"HA router with agent mode DVR_SNAT\"? Does ha+distribute router not have HA_INTERFACE_KEY attribute?","commit_id":"f9344ca2c9f71dd43a51a8277771eba621b54278"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"9aa58aa9bd4b6eb11610189e7bbeaa13fdc10f50","unresolved":false,"context_lines":[{"line_number":706,"context_line":"            if interface:"},{"line_number":707,"context_line":"                self._populate_mtu_and_subnets_for_ports(context, [interface])"},{"line_number":708,"context_line":""},{"line_number":709,"context_line":"        # Could not filter the HA_INTERFACE_KEY here, because a DVR router"},{"line_number":710,"context_line":"        # with SNAT HA in DVR compute host also does not have that attribute."},{"line_number":711,"context_line":"        return list(routers_dict.values())"},{"line_number":712,"context_line":""},{"line_number":713,"context_line":"    @log_helpers.log_method_call"}],"source_content_type":"text/x-python","patch_set":18,"id":"bacf61ea_589589e2","line":710,"range":{"start_line":709,"start_character":64,"end_line":710,"end_character":42},"in_reply_to":"bacf61ea_adad6933","updated":"2016-07-28 05:31:17.000000000","message":"Consider that a router is distributed and HA, but it act as a DvrLocalRouter in compute host which does not need/have the HA_INTERFACE_KEY, because there is no L3HARouterAgentPortBinding for the dvr(and ha) router in that compute host.","commit_id":"f9344ca2c9f71dd43a51a8277771eba621b54278"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3aa66d7f5b9ac18b18d589b44c5af4a50822e409","unresolved":false,"context_lines":[{"line_number":696,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":697,"context_line":"                                                    routers_dict.keys(),"},{"line_number":698,"context_line":"                                                    host)"},{"line_number":699,"context_line":"        for binding in bindings:"},{"line_number":700,"context_line":"            port_dict \u003d self._core_plugin._make_port_dict(binding.port)"},{"line_number":701,"context_line":""},{"line_number":702,"context_line":"            router \u003d routers_dict.get(binding.router_id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_b60e4a32","side":"PARENT","line":699,"updated":"2016-07-28 09:57:42.000000000","message":"just add a line here:\n\nif not binding.port:\n    # Filter the HA router has no ha port here\n    routers_dict.pop(binding.router_id)\n    continue","commit_id":"1750d757613d08cb16fa16a5c76d52408590f6c2"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a7711a5c592a2a2bcb255a4be3e85b6da64d89e0","unresolved":false,"context_lines":[{"line_number":696,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":697,"context_line":"                                                    routers_dict.keys(),"},{"line_number":698,"context_line":"                                                    host)"},{"line_number":699,"context_line":"        for binding in bindings:"},{"line_number":700,"context_line":"            port_dict \u003d self._core_plugin._make_port_dict(binding.port)"},{"line_number":701,"context_line":""},{"line_number":702,"context_line":"            router \u003d routers_dict.get(binding.router_id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_7cbf93d0","side":"PARENT","line":699,"in_reply_to":"bacf61ea_391b6d74","updated":"2016-07-28 10:35:44.000000000","message":"In case something is expiring the relationship:\n\nport \u003d binding.port\nif not port:\n    # Filter the HA router has no ha port here\n    routers_dict.pop(binding.router_id)\n    continue\nport_dict \u003d self._core_plugin._make_port_dict(port)","commit_id":"1750d757613d08cb16fa16a5c76d52408590f6c2"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"b26ab0afbaeeeb2232f84feedcbb30d1caef1f53","unresolved":false,"context_lines":[{"line_number":696,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":697,"context_line":"                                                    routers_dict.keys(),"},{"line_number":698,"context_line":"                                                    host)"},{"line_number":699,"context_line":"        for binding in bindings:"},{"line_number":700,"context_line":"            port_dict \u003d self._core_plugin._make_port_dict(binding.port)"},{"line_number":701,"context_line":""},{"line_number":702,"context_line":"            router \u003d routers_dict.get(binding.router_id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_9f5eb9e7","side":"PARENT","line":699,"in_reply_to":"bacf61ea_7cbf93d0","updated":"2016-07-28 12:18:00.000000000","message":"Done","commit_id":"1750d757613d08cb16fa16a5c76d52408590f6c2"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"fe3fecb86b2d26193b727e8e52b47c8c598271be","unresolved":false,"context_lines":[{"line_number":696,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":697,"context_line":"                                                    routers_dict.keys(),"},{"line_number":698,"context_line":"                                                    host)"},{"line_number":699,"context_line":"        for binding in bindings:"},{"line_number":700,"context_line":"            port_dict \u003d self._core_plugin._make_port_dict(binding.port)"},{"line_number":701,"context_line":""},{"line_number":702,"context_line":"            router \u003d routers_dict.get(binding.router_id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_f679e230","side":"PARENT","line":699,"in_reply_to":"bacf61ea_b60e4a32","updated":"2016-07-28 10:05:51.000000000","message":"What if the race just happened in this line?\nSome thing like this:\n1. binding.port is not None (RPC)\n2. goto _make_port_dict  (RPC)\n3. binding.port is deleted  (API, delete_router)\n4. None TypeError ? (RPC)","commit_id":"1750d757613d08cb16fa16a5c76d52408590f6c2"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"1834113a334980f2ae54ab0f03cd52fae5fffc02","unresolved":false,"context_lines":[{"line_number":696,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":697,"context_line":"                                                    routers_dict.keys(),"},{"line_number":698,"context_line":"                                                    host)"},{"line_number":699,"context_line":"        for binding in bindings:"},{"line_number":700,"context_line":"            port_dict \u003d self._core_plugin._make_port_dict(binding.port)"},{"line_number":701,"context_line":""},{"line_number":702,"context_line":"            router \u003d routers_dict.get(binding.router_id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_391b6d74","side":"PARENT","line":699,"in_reply_to":"bacf61ea_f679e230","updated":"2016-07-28 10:14:45.000000000","message":"once you look up binding.port, the data is retrieved from the database and is safe to use after that.\n\nThe problem is that the binding relationship to port is not joined, it\u0027s using the default of \u0027select\u0027 which doesn\u0027t query the database until it is first referenced. Another fix would be to change that to \u0027joined\u0027, but that may cause an unnecessary performance hit somewhere else.","commit_id":"1750d757613d08cb16fa16a5c76d52408590f6c2"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"3aa66d7f5b9ac18b18d589b44c5af4a50822e409","unresolved":false,"context_lines":[{"line_number":702,"context_line":"                # Let the core plugin process the port dict"},{"line_number":703,"context_line":"                port_dict \u003d self._core_plugin.get_port(context,"},{"line_number":704,"context_line":"                                                       binding.port_id)"},{"line_number":705,"context_line":"                router[constants.HA_INTERFACE_KEY] \u003d port_dict"},{"line_number":706,"context_line":"            except n_exc.PortNotFound:"},{"line_number":707,"context_line":"                with excutils.save_and_reraise_exception() as ctx:"},{"line_number":708,"context_line":"                    # Should not block all other routers sync RPC"}],"source_content_type":"text/x-python","patch_set":19,"id":"bacf61ea_163bd6d2","line":705,"updated":"2016-07-28 09:57:42.000000000","message":"we don\u0027t need to call the core plugin. see example on the left.","commit_id":"1650d764779fbb4fa7c44095222fd6f151093b93"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"bb9f4c32ea8c5baa6f0355c96c88a951b1c4b445","unresolved":false,"context_lines":[{"line_number":700,"context_line":"            port \u003d binding.port"},{"line_number":701,"context_line":"            if not port:"},{"line_number":702,"context_line":"                # Filter the HA router has no ha port here"},{"line_number":703,"context_line":"                LOG.debug(\"HA router %s has no ha router port bindings \""},{"line_number":704,"context_line":"                          \"port, skip sync ha data.\","},{"line_number":705,"context_line":"                          binding.router_id)"},{"line_number":706,"context_line":"                routers_dict.pop(binding.router_id)"},{"line_number":707,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":20,"id":"bacf61ea_6b94e736","line":704,"range":{"start_line":703,"start_character":26,"end_line":704,"end_character":52},"updated":"2016-07-28 12:03:04.000000000","message":"Please modify to the following:\n\n\"HA router %s is missing HA router port bindings. Skipping it.\"\n\nAlso, change the message level to info instead (i.e. LOG.info(\"...\")).","commit_id":"e3852b74450822efb538c21d6b96f5cb2e82b285"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"a792b48a0adb3ea752c57a3542a362e65c56c582","unresolved":false,"context_lines":[{"line_number":700,"context_line":"            port \u003d binding.port"},{"line_number":701,"context_line":"            if not port:"},{"line_number":702,"context_line":"                # Filter the HA router has no ha port here"},{"line_number":703,"context_line":"                LOG.debug(\"HA router %s has no ha router port bindings \""},{"line_number":704,"context_line":"                          \"port, skip sync ha data.\","},{"line_number":705,"context_line":"                          binding.router_id)"},{"line_number":706,"context_line":"                routers_dict.pop(binding.router_id)"},{"line_number":707,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":20,"id":"bacf61ea_9d5d1eec","line":704,"range":{"start_line":703,"start_character":26,"end_line":704,"end_character":52},"in_reply_to":"bacf61ea_6b94e736","updated":"2016-07-28 12:19:06.000000000","message":"Done","commit_id":"e3852b74450822efb538c21d6b96f5cb2e82b285"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2711f30a17632f605f893df927e16f6ba5a905a1","unresolved":false,"context_lines":[{"line_number":694,"context_line":"    def _process_sync_ha_data(self, context, routers, host):"},{"line_number":695,"context_line":"        routers_dict \u003d dict((router[\u0027id\u0027], router) for router in routers)"},{"line_number":696,"context_line":""},{"line_number":697,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":698,"context_line":"                                                    routers_dict.keys(),"},{"line_number":699,"context_line":"                                                    host)"},{"line_number":700,"context_line":"        for binding in bindings:"}],"source_content_type":"text/x-python","patch_set":21,"id":"bacf61ea_9f7d07b4","line":697,"updated":"2016-07-28 15:44:24.000000000","message":"would it no be better to filter the ports in this method?","commit_id":"5846da38adaadaa2b638e7f1cfe44c1df34b37cc"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"a52960a5f0a7ac33ecb835f29e8dd58295d6ebaa","unresolved":false,"context_lines":[{"line_number":694,"context_line":"    def _process_sync_ha_data(self, context, routers, host):"},{"line_number":695,"context_line":"        routers_dict \u003d dict((router[\u0027id\u0027], router) for router in routers)"},{"line_number":696,"context_line":""},{"line_number":697,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":698,"context_line":"                                                    routers_dict.keys(),"},{"line_number":699,"context_line":"                                                    host)"},{"line_number":700,"context_line":"        for binding in bindings:"}],"source_content_type":"text/x-python","patch_set":21,"id":"bacf61ea_1f13c267","line":697,"in_reply_to":"bacf61ea_227318e9","updated":"2016-07-28 23:02:38.000000000","message":"So when could a fully-built HA router has no ha_port_bindings port after that ALLOCATING patch? For now it\u0027s only in a deleting procedure. So for this creating and deleting race condition, IMHO, filter it, cost less and make more sense.","commit_id":"5846da38adaadaa2b638e7f1cfe44c1df34b37cc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"cbbf2109c0c7f0234ff50c2f2c52d5b7a20f0d01","unresolved":false,"context_lines":[{"line_number":694,"context_line":"    def _process_sync_ha_data(self, context, routers, host):"},{"line_number":695,"context_line":"        routers_dict \u003d dict((router[\u0027id\u0027], router) for router in routers)"},{"line_number":696,"context_line":""},{"line_number":697,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":698,"context_line":"                                                    routers_dict.keys(),"},{"line_number":699,"context_line":"                                                    host)"},{"line_number":700,"context_line":"        for binding in bindings:"}],"source_content_type":"text/x-python","patch_set":21,"id":"bacf61ea_52afe880","line":697,"in_reply_to":"bacf61ea_227318e9","updated":"2016-07-29 03:29:01.000000000","message":"several users of it don\u0027t reference the port. it\u0027s a more expensive join for those cases for no reason.","commit_id":"5846da38adaadaa2b638e7f1cfe44c1df34b37cc"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"c0bc10f29bbf5f89ff99635fa941ac5d46748b4d","unresolved":false,"context_lines":[{"line_number":694,"context_line":"    def _process_sync_ha_data(self, context, routers, host):"},{"line_number":695,"context_line":"        routers_dict \u003d dict((router[\u0027id\u0027], router) for router in routers)"},{"line_number":696,"context_line":""},{"line_number":697,"context_line":"        bindings \u003d self.get_ha_router_port_bindings(context,"},{"line_number":698,"context_line":"                                                    routers_dict.keys(),"},{"line_number":699,"context_line":"                                                    host)"},{"line_number":700,"context_line":"        for binding in bindings:"}],"source_content_type":"text/x-python","patch_set":21,"id":"bacf61ea_227318e9","line":697,"in_reply_to":"bacf61ea_9f7d07b4","updated":"2016-07-28 18:58:47.000000000","message":"I tend to agree. The method needs to return its data atomically. Either the port is there or it isn\u0027t.","commit_id":"5846da38adaadaa2b638e7f1cfe44c1df34b37cc"}],"neutron/tests/unit/db/test_l3_hamode_db.py":[{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"6441bea6d13aad358878d77be76e7d86fed598c1","unresolved":false,"context_lines":[{"line_number":655,"context_line":"    def test_sync_ha_router_info_without_ha_port(self):"},{"line_number":656,"context_line":"        router1 \u003d self._create_router()"},{"line_number":657,"context_line":"        self._bind_router(router1[\u0027id\u0027])"},{"line_number":658,"context_line":"        router2 \u003d self._create_router()"},{"line_number":659,"context_line":"        self._bind_router(router2[\u0027id\u0027])"},{"line_number":660,"context_line":"        bindings \u003d self.plugin.get_ha_router_port_bindings("},{"line_number":661,"context_line":"            self.admin_ctx, [router1[\u0027id\u0027], router2[\u0027id\u0027]])"}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_1619e988","line":658,"range":{"start_line":658,"start_character":8,"end_line":658,"end_character":39},"updated":"2016-03-02 09:43:26.000000000","message":"just curious: why we need to create 2 routers here?","commit_id":"226d76666eabfa84ab18df3eade10a2afa11092c"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"efe608d55220f47efcbaa145f1e20cf14ef7d8ba","unresolved":false,"context_lines":[{"line_number":655,"context_line":"    def test_sync_ha_router_info_without_ha_port(self):"},{"line_number":656,"context_line":"        router1 \u003d self._create_router()"},{"line_number":657,"context_line":"        self._bind_router(router1[\u0027id\u0027])"},{"line_number":658,"context_line":"        router2 \u003d self._create_router()"},{"line_number":659,"context_line":"        self._bind_router(router2[\u0027id\u0027])"},{"line_number":660,"context_line":"        bindings \u003d self.plugin.get_ha_router_port_bindings("},{"line_number":661,"context_line":"            self.admin_ctx, [router1[\u0027id\u0027], router2[\u0027id\u0027]])"}],"source_content_type":"text/x-python","patch_set":6,"id":"7af24918_0ad255d2","line":658,"range":{"start_line":658,"start_character":8,"end_line":658,"end_character":39},"in_reply_to":"7af24918_1619e988","updated":"2016-03-02 11:33:08.000000000","message":"Indeed, it\u0027s not needed in this test case, some code copy from the former, it\u0027s used to ensure that all router state, both active and standby,  could be covered. Maybe I need add some result check for agent2. Or just remove one.","commit_id":"226d76666eabfa84ab18df3eade10a2afa11092c"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"082769899d82cb5932bd14350c7b393657da78a9","unresolved":false,"context_lines":[{"line_number":651,"context_line":"            self.assertEqual(states[router[\u0027id\u0027]],"},{"line_number":652,"context_line":"                             router[constants.HA_ROUTER_STATE_KEY])"},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"    def test_sync_ha_router_info_without_ha_port(self):"},{"line_number":655,"context_line":"        router1 \u003d self._create_router()"},{"line_number":656,"context_line":"        self._bind_router(router1[\u0027id\u0027])"},{"line_number":657,"context_line":"        router2 \u003d self._create_router()"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_1b379fe4","line":654,"updated":"2016-03-28 15:42:11.000000000","message":"Also please update this test like below,\n1) mock _make_port_dict to raise exception, and get_ha_sync_data_for_host should handle it properly and won\u0027t return that router.","commit_id":"83729cca7b30a6d8c937e51fd4cc74e013782e03"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"2caa682b9012d0ee8f4caa0c6253d0c29206a17a","unresolved":false,"context_lines":[{"line_number":651,"context_line":"            self.assertEqual(states[router[\u0027id\u0027]],"},{"line_number":652,"context_line":"                             router[constants.HA_ROUTER_STATE_KEY])"},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"    def test_sync_ha_router_info_without_ha_port(self):"},{"line_number":655,"context_line":"        router1 \u003d self._create_router()"},{"line_number":656,"context_line":"        self._bind_router(router1[\u0027id\u0027])"},{"line_number":657,"context_line":"        router2 \u003d self._create_router()"}],"source_content_type":"text/x-python","patch_set":12,"id":"ba0121b8_9fb6e53b","line":654,"in_reply_to":"ba0121b8_1b379fe4","updated":"2016-03-29 02:00:13.000000000","message":"This case means that _make_port_dict has no chance to get a None port.","commit_id":"83729cca7b30a6d8c937e51fd4cc74e013782e03"}]}
