)]}'
{"neutron/db/l3_hamode_db.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"efdc0d0a6ce4493f64038af80600832f2a576c70","unresolved":false,"context_lines":[{"line_number":585,"context_line":"        # calls might try to retrieve partial/incorrect information, so we mark"},{"line_number":586,"context_line":"        # the router as ALLOCATING to ensure that if an exception is raised"},{"line_number":587,"context_line":"        # it\u0027s easy to tell if it\u0027s concurrently being deleted/allocated."},{"line_number":588,"context_line":"        router_db \u003d super(L3_HA_NAT_db_mixin, self)._update_router_db("},{"line_number":589,"context_line":"            context, id, {\u0027status\u0027: n_const.ROUTER_STATUS_ALLOCATING})"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        super(L3_HA_NAT_db_mixin, self).delete_router(context, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_3cf07b90","line":588,"updated":"2016-07-28 10:38:56.000000000","message":"i think you need to wrap the super delete call with a try: except to change the status back to whatever it was in case it fails on a validation check or something.","commit_id":"5e4e6bd48c92681827c3d055eaf9d810285f4c5b"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"995a9f50ef52d7f114b444758ed601ef629546bb","unresolved":false,"context_lines":[{"line_number":585,"context_line":"        # calls might try to retrieve partial/incorrect information, so we mark"},{"line_number":586,"context_line":"        # the router as ALLOCATING to ensure that if an exception is raised"},{"line_number":587,"context_line":"        # it\u0027s easy to tell if it\u0027s concurrently being deleted/allocated."},{"line_number":588,"context_line":"        router_db \u003d super(L3_HA_NAT_db_mixin, self)._update_router_db("},{"line_number":589,"context_line":"            context, id, {\u0027status\u0027: n_const.ROUTER_STATUS_ALLOCATING})"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        super(L3_HA_NAT_db_mixin, self).delete_router(context, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_25321ef2","line":588,"in_reply_to":"bacf61ea_3cf07b90","updated":"2016-07-28 11:18:04.000000000","message":"Done","commit_id":"5e4e6bd48c92681827c3d055eaf9d810285f4c5b"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"c4c0045a01504908ebec11e6b593ee7c00023c24","unresolved":false,"context_lines":[{"line_number":585,"context_line":"        # calls might try to retrieve partial/incorrect information, so we mark"},{"line_number":586,"context_line":"        # the router as ALLOCATING to ensure that if an exception is raised"},{"line_number":587,"context_line":"        # it\u0027s easy to tell if it\u0027s concurrently being deleted/allocated."},{"line_number":588,"context_line":"        original_status \u003d self._get_router(context, id).status"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"        router_db \u003d super(L3_HA_NAT_db_mixin, self)._update_router_db("},{"line_number":591,"context_line":"            context, id, {\u0027status\u0027: n_const.ROUTER_STATUS_ALLOCATING})"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"        try:"},{"line_number":594,"context_line":"            super(L3_HA_NAT_db_mixin, self).delete_router(context, id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_d63317f5","line":591,"range":{"start_line":588,"start_character":8,"end_line":591,"end_character":70},"updated":"2016-08-19 03:40:11.000000000","message":"May introduce new race condition between creating and updating.","commit_id":"cb7244c5ab27b0ac13d4ba99f6fae0d6a38f391b"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"9956a42aea36c238f6111dbb210b9efa80e8390f","unresolved":false,"context_lines":[{"line_number":585,"context_line":"        # calls might try to retrieve partial/incorrect information, so we mark"},{"line_number":586,"context_line":"        # the router as ALLOCATING to ensure that if an exception is raised"},{"line_number":587,"context_line":"        # it\u0027s easy to tell if it\u0027s concurrently being deleted/allocated."},{"line_number":588,"context_line":"        original_status \u003d self._get_router(context, id).status"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"        router_db \u003d super(L3_HA_NAT_db_mixin, self)._update_router_db("},{"line_number":591,"context_line":"            context, id, {\u0027status\u0027: n_const.ROUTER_STATUS_ALLOCATING})"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"        try:"},{"line_number":594,"context_line":"            super(L3_HA_NAT_db_mixin, self).delete_router(context, id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_68ba3f70","line":591,"range":{"start_line":588,"start_character":8,"end_line":591,"end_character":70},"in_reply_to":"3ac371cc_02872913","updated":"2016-08-19 07:02:20.000000000","message":"Line 486-490 and Line 570-574 will be racy with this _update_router_db here.\nRPC synced HA router and this is also a race condition.\n\nIMHO, this updating state is no use, let\u0027s consider the race we\u0027ve dealt with for a long time, aka race between creating and deleting, and we\u0027ve discussed about that here: https://review.openstack.org/#/c/265672/ in Patch set 10:\n\"\"\"\n@Kevin Benton, hi, it\u0027s mainly because a fully-built (active) HA router is free to delete.\nSome procedure may like this:\n1. HA router creating, allocating state\n2. HA attributes created, active state\n3. HA router schedule to L3 agent\n4. (race) L3 agent sync HA router info\n5. (race) A HA router delete API comes, HA attributes(L3HARouterAgentPortBinding) was deleted.\n  5.1 (race) RPC, synced HA router basic info\n  5.2 (race) API, deleted router DB and ha router bindings\n6. (race) synced a HA router info without HA port\n\"\"\"\n\n\nWe can see that this patch doing something in 5.2, but in function _process_sync_ha_data there is no such state check.\nEven one day it will have a check, then the race will be there between that check and this set ALLOCATING state.\nSo I\u0027d like to say `make the deletion run naturally and smoothly`.\nMaybe the object version is right approach to prevent such race totally.","commit_id":"cb7244c5ab27b0ac13d4ba99f6fae0d6a38f391b"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"a15af797e0e8cedd3d8799f71783640c49ada01b","unresolved":false,"context_lines":[{"line_number":585,"context_line":"        # calls might try to retrieve partial/incorrect information, so we mark"},{"line_number":586,"context_line":"        # the router as ALLOCATING to ensure that if an exception is raised"},{"line_number":587,"context_line":"        # it\u0027s easy to tell if it\u0027s concurrently being deleted/allocated."},{"line_number":588,"context_line":"        original_status \u003d self._get_router(context, id).status"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"        router_db \u003d super(L3_HA_NAT_db_mixin, self)._update_router_db("},{"line_number":591,"context_line":"            context, id, {\u0027status\u0027: n_const.ROUTER_STATUS_ALLOCATING})"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"        try:"},{"line_number":594,"context_line":"            super(L3_HA_NAT_db_mixin, self).delete_router(context, id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_b76e4e94","line":591,"range":{"start_line":588,"start_character":8,"end_line":591,"end_character":70},"in_reply_to":"3ac371cc_68ba3f70","updated":"2016-08-19 08:44:15.000000000","message":"Regarding the race condition that relates to line 570-574 that is supposed to be triggered from this code - there is none. this _update_router_db doesn\u0027t trigger lines 570 at all because ha_changed will be false and the function will return in line 547.\n\nThe race condition (if one even exists) between 2 concurrent create_router is not relevant to this patch and shouldn\u0027t be blocking this patch at all.\n\nRegarding the \"naturally and smoothly\", I discussed this with LIU over IRC [1]. His intention is that we make delete_router to always validate that all of its resources have been deleted, but this is counter-productive in the case of a delete_router that is run concurrently to a create_router; a user doesn\u0027t care if some of its router\u0027s resources have been left behind after its router has been deleted, but a user will VERY much mind if a router is missing resources after it was created. Thus, create_router should take priority.\n\n[1]: http://eavesdrop.openstack.org/irclogs/%23openstack-neutron/%23openstack-neutron.2016-08-19.log.html#t2016-08-19T08:25:30","commit_id":"cb7244c5ab27b0ac13d4ba99f6fae0d6a38f391b"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"98a1ebb891ea0591490e35cb30c702b4e27217c8","unresolved":false,"context_lines":[{"line_number":585,"context_line":"        # calls might try to retrieve partial/incorrect information, so we mark"},{"line_number":586,"context_line":"        # the router as ALLOCATING to ensure that if an exception is raised"},{"line_number":587,"context_line":"        # it\u0027s easy to tell if it\u0027s concurrently being deleted/allocated."},{"line_number":588,"context_line":"        original_status \u003d self._get_router(context, id).status"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"        router_db \u003d super(L3_HA_NAT_db_mixin, self)._update_router_db("},{"line_number":591,"context_line":"            context, id, {\u0027status\u0027: n_const.ROUTER_STATUS_ALLOCATING})"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"        try:"},{"line_number":594,"context_line":"            super(L3_HA_NAT_db_mixin, self).delete_router(context, id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ac371cc_02872913","line":591,"range":{"start_line":588,"start_character":8,"end_line":591,"end_character":70},"in_reply_to":"3ac371cc_d63317f5","updated":"2016-08-19 06:26:35.000000000","message":"@LIU Yulong,\nCan you please explain more on - \"new race condition between creating and updating?\"\n\nHere, he is updating DB first(L590) and then starting the router deletion process(L594), so there won\u0027t be a race.","commit_id":"cb7244c5ab27b0ac13d4ba99f6fae0d6a38f391b"}]}
