)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"516e09fff3b3259f3611ad42894c78233fdebba5","unresolved":false,"context_lines":[{"line_number":13,"context_line":"delete api, then the exception raised."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I41e199f9b8ece53819e32303401052fd0479575b"},{"line_number":16,"context_line":"Closes-Bug: #1523780"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da6ed579_f7ebb076","line":16,"range":{"start_line":16,"start_character":13,"end_line":16,"end_character":20},"updated":"2016-01-12 23:02:43.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":"65fa9d0f412f313bfaa38ef6d10ff70cdb50a8e4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"ee71850d4d8d0d305d9c14d52e75d9baba1f9fdf","unresolved":false,"context_lines":[{"line_number":13,"context_line":"delete api, then the exception raised."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I41e199f9b8ece53819e32303401052fd0479575b"},{"line_number":16,"context_line":"Closes-Bug: #1523780"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da6ed579_70f261d4","line":16,"range":{"start_line":16,"start_character":13,"end_line":16,"end_character":20},"updated":"2016-01-13 03:09:23.000000000","message":"New LP bug #1533443","commit_id":"65fa9d0f412f313bfaa38ef6d10ff70cdb50a8e4"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"73a00d9df8246e5ce0f7c79c68130c38bb6941c4","unresolved":false,"context_lines":[{"line_number":13,"context_line":"delete api, then the exception raised."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I41e199f9b8ece53819e32303401052fd0479575b"},{"line_number":16,"context_line":"Closes-Bug: #1523780"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da6ed579_5a4e5c97","line":16,"range":{"start_line":16,"start_character":13,"end_line":16,"end_character":20},"in_reply_to":"da6ed579_f7ebb076","updated":"2016-01-13 02:19:41.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":"65fa9d0f412f313bfaa38ef6d10ff70cdb50a8e4"}],"neutron/plugins/ml2/db.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"da268440903df0c472458799d71dcb0b0d7b3147","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        return record"},{"line_number":257,"context_line":"    except exc.NoResultFound:"},{"line_number":258,"context_line":"        return"},{"line_number":259,"context_line":"    except exc.MultipleResultsFound:"},{"line_number":260,"context_line":"        LOG.error(_LE(\"Multiple ports have port_id starting with %s\"),"},{"line_number":261,"context_line":"                  port_id)"},{"line_number":262,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa0719c6_8e6c0b9e","line":259,"updated":"2016-03-20 13:59:47.000000000","message":"The UUID is the primary key. How can we get multiple results?","commit_id":"bddf99ce7c7ae3a4ccf52688952f4fa472de667d"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"e63d707e4ca58f8866aec3bc35a146c3cdeb7559","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        return record"},{"line_number":257,"context_line":"    except exc.NoResultFound:"},{"line_number":258,"context_line":"        return"},{"line_number":259,"context_line":"    except exc.MultipleResultsFound:"},{"line_number":260,"context_line":"        LOG.error(_LE(\"Multiple ports have port_id starting with %s\"),"},{"line_number":261,"context_line":"                  port_id)"},{"line_number":262,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa0719c6_a4be4bfd","line":259,"in_reply_to":"fa0719c6_8e6c0b9e","updated":"2016-03-21 01:51:04.000000000","message":"It\u0027s a \u0027startswith\u0027 expression (L236 and L253).","commit_id":"bddf99ce7c7ae3a4ccf52688952f4fa472de667d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ba9d00d6cb6b7b02d4100e97304ac80896747a74","unresolved":false,"context_lines":[{"line_number":172,"context_line":"    try:"},{"line_number":173,"context_line":"        record \u003d (session.query(models_v2.Port)."},{"line_number":174,"context_line":"                  enable_eagerloads(False)."},{"line_number":175,"context_line":"                  filter(models_v2.Port.id.startswith(port_id))."},{"line_number":176,"context_line":"                  with_lockmode(\u0027update\u0027)."},{"line_number":177,"context_line":"                  one())"},{"line_number":178,"context_line":"        return record"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_f8d29b33","line":175,"updated":"2016-04-04 14:18:48.000000000","message":"why do you need to use starts_with, and not just \u003d\u003d to port_id?","commit_id":"b152842979d0e970c3592af5038fd61ba98746e2"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8977f793c66558b96855ae280efd3f47c91fc8f7","unresolved":false,"context_lines":[{"line_number":172,"context_line":"    try:"},{"line_number":173,"context_line":"        record \u003d (session.query(models_v2.Port)."},{"line_number":174,"context_line":"                  enable_eagerloads(False)."},{"line_number":175,"context_line":"                  filter(models_v2.Port.id.startswith(port_id))."},{"line_number":176,"context_line":"                  with_lockmode(\u0027update\u0027)."},{"line_number":177,"context_line":"                  one())"},{"line_number":178,"context_line":"        return record"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_842679b8","line":175,"in_reply_to":"9a061dce_f8d29b33","updated":"2016-04-05 07:20:40.000000000","message":"ML2 may have a port_id like port_id[:12]. Next patch will remove this function.","commit_id":"b152842979d0e970c3592af5038fd61ba98746e2"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ba9d00d6cb6b7b02d4100e97304ac80896747a74","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    except exc.NoResultFound:"},{"line_number":180,"context_line":"        return"},{"line_number":181,"context_line":"    except exc.MultipleResultsFound:"},{"line_number":182,"context_line":"        LOG.error(_LE(\"Multiple ports have port_id starting with %s\"),"},{"line_number":183,"context_line":"                  port_id)"},{"line_number":184,"context_line":"        return"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_38dd3343","line":182,"updated":"2016-04-04 14:18:48.000000000","message":"ditto.","commit_id":"b152842979d0e970c3592af5038fd61ba98746e2"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8977f793c66558b96855ae280efd3f47c91fc8f7","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    except exc.NoResultFound:"},{"line_number":180,"context_line":"        return"},{"line_number":181,"context_line":"    except exc.MultipleResultsFound:"},{"line_number":182,"context_line":"        LOG.error(_LE(\"Multiple ports have port_id starting with %s\"),"},{"line_number":183,"context_line":"                  port_id)"},{"line_number":184,"context_line":"        return"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_24320df2","line":182,"in_reply_to":"9a061dce_38dd3343","updated":"2016-04-05 07:20:40.000000000","message":"Next patch will remove this function.","commit_id":"b152842979d0e970c3592af5038fd61ba98746e2"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"e8e6730c2fcb74eb7482c0ca6b78f39ad2dda0cb","unresolved":false,"context_lines":[{"line_number":1454,"context_line":"            try:"},{"line_number":1455,"context_line":"                port_db \u003d (session.query(models_v2.Port)."},{"line_number":1456,"context_line":"                           enable_eagerloads(False)."},{"line_number":1457,"context_line":"                           filter(models_v2.Port.id.startswith(port_id))."},{"line_number":1458,"context_line":"                           one())"},{"line_number":1459,"context_line":"            except sa_exc.NoResultFound:"},{"line_number":1460,"context_line":"                LOG.debug(\"No ports have port_id starting with %s\","}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_4eaa3a1a","side":"PARENT","line":1457,"updated":"2016-03-10 08:37:35.000000000","message":"Oh, I see now. I was thinking it was the regular plugin.get_port call.","commit_id":"3fb153b15b7d846947476221c79b129c878d4e56"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"76812f7e32cb5d2bb3efbcf1dec0c82d347ff1e7","unresolved":false,"context_lines":[{"line_number":1454,"context_line":"            try:"},{"line_number":1455,"context_line":"                port_db \u003d (session.query(models_v2.Port)."},{"line_number":1456,"context_line":"                           enable_eagerloads(False)."},{"line_number":1457,"context_line":"                           filter(models_v2.Port.id.startswith(port_id))."},{"line_number":1458,"context_line":"                           one())"},{"line_number":1459,"context_line":"            except sa_exc.NoResultFound:"},{"line_number":1460,"context_line":"                LOG.debug(\"No ports have port_id starting with %s\","}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_7ebb1173","side":"PARENT","line":1457,"updated":"2016-02-26 05:24:33.000000000","message":"You can\u0027t get rid of this. The caller of get_bound_port_context may only be passing in the start of the port UUID (e.g. if Linux Bridge agent is used).","commit_id":"3fb153b15b7d846947476221c79b129c878d4e56"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"267b258db67dc46409b924c6b33850e888a6f0ae","unresolved":false,"context_lines":[{"line_number":1454,"context_line":"            try:"},{"line_number":1455,"context_line":"                port_db \u003d (session.query(models_v2.Port)."},{"line_number":1456,"context_line":"                           enable_eagerloads(False)."},{"line_number":1457,"context_line":"                           filter(models_v2.Port.id.startswith(port_id))."},{"line_number":1458,"context_line":"                           one())"},{"line_number":1459,"context_line":"            except sa_exc.NoResultFound:"},{"line_number":1460,"context_line":"                LOG.debug(\"No ports have port_id starting with %s\","}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_c4afebe1","side":"PARENT","line":1457,"in_reply_to":"9aed3d3a_7ebb1173","updated":"2016-02-26 08:21:47.000000000","message":"It\u0027s totally same code. So why?","commit_id":"3fb153b15b7d846947476221c79b129c878d4e56"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"76812f7e32cb5d2bb3efbcf1dec0c82d347ff1e7","unresolved":false,"context_lines":[{"line_number":1493,"context_line":"                        self, plugin_context, port, network, binding, levels)"},{"line_number":1494,"context_line":""},{"line_number":1495,"context_line":"                return self._bind_port_if_needed(port_context)"},{"line_number":1496,"context_line":"            except os_db_exception.DBError:"},{"line_number":1497,"context_line":"                # Any step which use the port_db may"},{"line_number":1498,"context_line":"                # got the DBError caused by concurrent port deletion."},{"line_number":1499,"context_line":"                LOG.debug(\"Port %s might have been deleted by concurrently \""}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_deb05d8e","line":1496,"updated":"2016-02-26 05:24:33.000000000","message":"most of this function is already checking for cases where the port was concurrently deleted. we need to narrow down this catch to the locations that are causing this exception","commit_id":"5f28cc4c41a8ceb268bbd08368dd610e87323faa"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"267b258db67dc46409b924c6b33850e888a6f0ae","unresolved":false,"context_lines":[{"line_number":1493,"context_line":"                        self, plugin_context, port, network, binding, levels)"},{"line_number":1494,"context_line":""},{"line_number":1495,"context_line":"                return self._bind_port_if_needed(port_context)"},{"line_number":1496,"context_line":"            except os_db_exception.DBError:"},{"line_number":1497,"context_line":"                # Any step which use the port_db may"},{"line_number":1498,"context_line":"                # got the DBError caused by concurrent port deletion."},{"line_number":1499,"context_line":"                LOG.debug(\"Port %s might have been deleted by concurrently \""}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_84dde344","line":1496,"in_reply_to":"9aed3d3a_deb05d8e","updated":"2016-02-26 08:21:47.000000000","message":"It\u0027s really a small chance that here got an Exception: \"DBError: UPDATE statement on table \u0027ports\u0027 expected to update 1 row(s); 0 were matched.\" It is not easy to reproduce that. It\u0027s been a quite while I\u0027ve not seen that exception for \u0027ports\u0027 table.","commit_id":"5f28cc4c41a8ceb268bbd08368dd610e87323faa"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"76812f7e32cb5d2bb3efbcf1dec0c82d347ff1e7","unresolved":false,"context_lines":[{"line_number":1503,"context_line":"        max_retries\u003ddb_api.MAX_RETRIES, retry_on_request\u003dTrue,"},{"line_number":1504,"context_line":"        exception_checker\u003dlambda e: isinstance(e, (sa_exc.StaleDataError,"},{"line_number":1505,"context_line":"                                                   os_db_exception.DBDeadlock,"},{"line_number":1506,"context_line":"                                                   os_db_exception.DBError))"},{"line_number":1507,"context_line":"    )"},{"line_number":1508,"context_line":"    def update_port_status(self, context, port_id, status, host\u003dNone,"},{"line_number":1509,"context_line":"                           network\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_bead9933","line":1506,"updated":"2016-02-26 05:24:33.000000000","message":"if DB errors are caused by the port going away, what would be the value in retrying the status update on an object that no longer exists?","commit_id":"5f28cc4c41a8ceb268bbd08368dd610e87323faa"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"30a9f57f030bfa4613f858d53e207cc4e2ebdc3b","unresolved":false,"context_lines":[{"line_number":1508,"context_line":"    @oslo_db_api.wrap_db_retry("},{"line_number":1509,"context_line":"        max_retries\u003ddb_api.MAX_RETRIES, retry_on_request\u003dTrue,"},{"line_number":1510,"context_line":"        exception_checker\u003dlambda e: isinstance(e, (sa_exc.StaleDataError,"},{"line_number":1511,"context_line":"                                                   os_db_exception.DBDeadlock))"},{"line_number":1512,"context_line":"    )"},{"line_number":1513,"context_line":"    def update_port_status(self, context, port_id, status, host\u003dNone,"},{"line_number":1514,"context_line":"                           network\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_11a7b7aa","line":1511,"updated":"2016-03-10 08:51:36.000000000","message":"I would rather have this catch the DBError here than spread the use of SELECT FOR UDPATE even further. It creates very different behavior between Neutron deployments depending on if Galera clusters are used.","commit_id":"c93fd802421c7f440f5ba46ae70b18ab57dfa4fe"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"5b42a2e486d3c455282018fb8367ee51f24db824","unresolved":false,"context_lines":[{"line_number":1508,"context_line":"    @oslo_db_api.wrap_db_retry("},{"line_number":1509,"context_line":"        max_retries\u003ddb_api.MAX_RETRIES, retry_on_request\u003dTrue,"},{"line_number":1510,"context_line":"        exception_checker\u003dlambda e: isinstance(e, (sa_exc.StaleDataError,"},{"line_number":1511,"context_line":"                                                   os_db_exception.DBDeadlock))"},{"line_number":1512,"context_line":"    )"},{"line_number":1513,"context_line":"    def update_port_status(self, context, port_id, status, host\u003dNone,"},{"line_number":1514,"context_line":"                           network\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_8408a3db","line":1511,"in_reply_to":"5aef4532_11a7b7aa","updated":"2016-03-10 09:16:55.000000000","message":"Yeah, I know that Galera cluster issue, but one of my colleague and the DBA have tested some DBDeadlock scenarios, the result shows that retry could work for the round robin active-active Galera clusters. And is DBError too robust for this concurrent update and delete scenario?","commit_id":"c93fd802421c7f440f5ba46ae70b18ab57dfa4fe"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ba9d00d6cb6b7b02d4100e97304ac80896747a74","unresolved":false,"context_lines":[{"line_number":1459,"context_line":"                           filter(models_v2.Port.id.startswith(port_id))."},{"line_number":1460,"context_line":"                           one())"},{"line_number":1461,"context_line":"            except sa_exc.NoResultFound:"},{"line_number":1462,"context_line":"                LOG.info(_LI(\"No ports have port_id starting with %s\"),"},{"line_number":1463,"context_line":"                         port_id)"},{"line_number":1464,"context_line":"                return"},{"line_number":1465,"context_line":"            except sa_exc.MultipleResultsFound:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_98c55f5d","side":"PARENT","line":1462,"updated":"2016-04-04 14:18:48.000000000","message":"I see it comes from here, but I don\u0027t understand it.","commit_id":"978672305d44844cd7353aadbf5c531d156841c0"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8977f793c66558b96855ae280efd3f47c91fc8f7","unresolved":false,"context_lines":[{"line_number":1459,"context_line":"                           filter(models_v2.Port.id.startswith(port_id))."},{"line_number":1460,"context_line":"                           one())"},{"line_number":1461,"context_line":"            except sa_exc.NoResultFound:"},{"line_number":1462,"context_line":"                LOG.info(_LI(\"No ports have port_id starting with %s\"),"},{"line_number":1463,"context_line":"                         port_id)"},{"line_number":1464,"context_line":"                return"},{"line_number":1465,"context_line":"            except sa_exc.MultipleResultsFound:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_248e8d78","side":"PARENT","line":1462,"in_reply_to":"9a061dce_98c55f5d","updated":"2016-04-05 07:20:40.000000000","message":"Just make the code more consistent by removing the redundant code.","commit_id":"978672305d44844cd7353aadbf5c531d156841c0"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ba9d00d6cb6b7b02d4100e97304ac80896747a74","unresolved":false,"context_lines":[{"line_number":1471,"context_line":"                    LOG.error(_LE(\"Binding info for DVR port %s not found\"),"},{"line_number":1472,"context_line":"                              port_id)"},{"line_number":1473,"context_line":"                    return"},{"line_number":1474,"context_line":"                levels \u003d db.get_binding_levels(session, port[\u0027id\u0027], host)"},{"line_number":1475,"context_line":"                port_context \u003d driver_context.PortContext("},{"line_number":1476,"context_line":"                    self, plugin_context, port, network, binding, levels)"},{"line_number":1477,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_d88cf737","line":1474,"updated":"2016-04-04 14:18:48.000000000","message":"nit: this change is unrelated.","commit_id":"b152842979d0e970c3592af5038fd61ba98746e2"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8977f793c66558b96855ae280efd3f47c91fc8f7","unresolved":false,"context_lines":[{"line_number":1471,"context_line":"                    LOG.error(_LE(\"Binding info for DVR port %s not found\"),"},{"line_number":1472,"context_line":"                              port_id)"},{"line_number":1473,"context_line":"                    return"},{"line_number":1474,"context_line":"                levels \u003d db.get_binding_levels(session, port[\u0027id\u0027], host)"},{"line_number":1475,"context_line":"                port_context \u003d driver_context.PortContext("},{"line_number":1476,"context_line":"                    self, plugin_context, port, network, binding, levels)"},{"line_number":1477,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_845e79e7","line":1474,"in_reply_to":"9a061dce_d88cf737","updated":"2016-04-05 07:20:40.000000000","message":"I just don\u0027t want the code here to reference the db object, aka port_db.","commit_id":"b152842979d0e970c3592af5038fd61ba98746e2"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ba9d00d6cb6b7b02d4100e97304ac80896747a74","unresolved":false,"context_lines":[{"line_number":1485,"context_line":"                                 \"it might have been deleted already.\"),"},{"line_number":1486,"context_line":"                             port_id)"},{"line_number":1487,"context_line":"                    return"},{"line_number":1488,"context_line":"                levels \u003d db.get_binding_levels(session, port[\u0027id\u0027],"},{"line_number":1489,"context_line":"                                               port_db.port_binding.host)"},{"line_number":1490,"context_line":"                port_context \u003d driver_context.PortContext("},{"line_number":1491,"context_line":"                    self, plugin_context, port, network, binding, levels)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_18878f10","line":1488,"updated":"2016-04-04 14:18:48.000000000","message":"unrelated.","commit_id":"b152842979d0e970c3592af5038fd61ba98746e2"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ba9d00d6cb6b7b02d4100e97304ac80896747a74","unresolved":false,"context_lines":[{"line_number":1508,"context_line":"        updated \u003d False"},{"line_number":1509,"context_line":"        session \u003d context.session"},{"line_number":1510,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":1511,"context_line":"            port \u003d db.get_locked_port(session, port_id)"},{"line_number":1512,"context_line":"            if not port:"},{"line_number":1513,"context_line":"                LOG.debug(\"Port %(port)s update to %(val)s by agent not found\","},{"line_number":1514,"context_line":"                          {\u0027port\u0027: port_id, \u0027val\u0027: status})"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_b84943d3","line":1511,"updated":"2016-04-04 14:18:48.000000000","message":"wouldn\u0027t we need some sort of DB retry mechanism wrapping the functions that get_locked_port?","commit_id":"b152842979d0e970c3592af5038fd61ba98746e2"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8977f793c66558b96855ae280efd3f47c91fc8f7","unresolved":false,"context_lines":[{"line_number":1508,"context_line":"        updated \u003d False"},{"line_number":1509,"context_line":"        session \u003d context.session"},{"line_number":1510,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":1511,"context_line":"            port \u003d db.get_locked_port(session, port_id)"},{"line_number":1512,"context_line":"            if not port:"},{"line_number":1513,"context_line":"                LOG.debug(\"Port %(port)s update to %(val)s by agent not found\","},{"line_number":1514,"context_line":"                          {\u0027port\u0027: port_id, \u0027val\u0027: status})"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_e465b5e1","line":1511,"in_reply_to":"9a061dce_b84943d3","updated":"2016-04-05 07:20:40.000000000","message":"It\u0027s something similar to ‘get_locked_port_and_binding’ in ml2 update_port and delete_port. Next patch will remove this change, and retry by catching the DBError.","commit_id":"b152842979d0e970c3592af5038fd61ba98746e2"}],"neutron/plugins/ml2/rpc.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"152716c5953290d865da9f5b624af04e34e145e9","unresolved":false,"context_lines":[{"line_number":78,"context_line":"                                                         port_id,"},{"line_number":79,"context_line":"                                                         host,"},{"line_number":80,"context_line":"                                                         cached_networks)"},{"line_number":81,"context_line":"        except os_db_exception.DBError:"},{"line_number":82,"context_line":"            port_context \u003d None"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        if not port_context:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a5ae5dd_beb73ff4","line":81,"updated":"2016-02-04 09:10:41.000000000","message":"this shouldn\u0027t be the responsibility of the caller to catch. it\u0027s expected for get_bound_port_context to return None if the port doesn\u0027t exist. The issue is likely that the port disappeared during the _bind_port_if_needed call. Fix that call to catch this exception and return None.","commit_id":"2cba67a4daa9991be33871af934228965efeb53a"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"28db5f85b9b425b7e477c213bac4b636fb455abd","unresolved":false,"context_lines":[{"line_number":78,"context_line":"                                                         port_id,"},{"line_number":79,"context_line":"                                                         host,"},{"line_number":80,"context_line":"                                                         cached_networks)"},{"line_number":81,"context_line":"        except os_db_exception.DBError:"},{"line_number":82,"context_line":"            port_context \u003d None"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        if not port_context:"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_9a7681d5","line":81,"in_reply_to":"5a5ae5dd_beb73ff4","updated":"2016-02-17 04:02:33.000000000","message":"Done","commit_id":"2cba67a4daa9991be33871af934228965efeb53a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"152716c5953290d865da9f5b624af04e34e145e9","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                                              new_status,"},{"line_number":116,"context_line":"                                              host,"},{"line_number":117,"context_line":"                                              port_context.network.current)"},{"line_number":118,"context_line":"                except os_db_exception.DBError:"},{"line_number":119,"context_line":"                    LOG.warning("},{"line_number":120,"context_line":"                        _LW(\"Failed to update port %(port_id)s with status \""},{"line_number":121,"context_line":"                            \"%(status)s on host %(host)s.\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a5ae5dd_5ecf2b7f","line":118,"updated":"2016-02-04 09:10:41.000000000","message":"Same thing here. Fix update_port_status to handle this exception. For this case you can add DBError to the wrap_db_retry decorator above it.","commit_id":"2cba67a4daa9991be33871af934228965efeb53a"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"28db5f85b9b425b7e477c213bac4b636fb455abd","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                                              new_status,"},{"line_number":116,"context_line":"                                              host,"},{"line_number":117,"context_line":"                                              port_context.network.current)"},{"line_number":118,"context_line":"                except os_db_exception.DBError:"},{"line_number":119,"context_line":"                    LOG.warning("},{"line_number":120,"context_line":"                        _LW(\"Failed to update port %(port_id)s with status \""},{"line_number":121,"context_line":"                            \"%(status)s on host %(host)s.\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_fa7fcda8","line":118,"in_reply_to":"5a5ae5dd_5ecf2b7f","updated":"2016-02-17 04:02:33.000000000","message":"Done","commit_id":"2cba67a4daa9991be33871af934228965efeb53a"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"76812f7e32cb5d2bb3efbcf1dec0c82d347ff1e7","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                    port_context.network.current)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"                if not port_id:"},{"line_number":114,"context_line":"                    LOG.warning("},{"line_number":115,"context_line":"                        _LW(\"Failed to update port %(port_id)s with status \""},{"line_number":116,"context_line":"                            \"%(status)s on host %(host)s.\"),"},{"line_number":117,"context_line":"                        {\u0027port_id\u0027: port_id,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_1eabe51e","line":114,"updated":"2016-02-26 05:24:33.000000000","message":"Is this just caused by a port being deleted? If so, that doesn\u0027t sound like a warning condition to me.","commit_id":"5f28cc4c41a8ceb268bbd08368dd610e87323faa"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"267b258db67dc46409b924c6b33850e888a6f0ae","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                    port_context.network.current)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"                if not port_id:"},{"line_number":114,"context_line":"                    LOG.warning("},{"line_number":115,"context_line":"                        _LW(\"Failed to update port %(port_id)s with status \""},{"line_number":116,"context_line":"                            \"%(status)s on host %(host)s.\"),"},{"line_number":117,"context_line":"                        {\u0027port_id\u0027: port_id,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_e4aaef6f","line":114,"in_reply_to":"9aed3d3a_1eabe51e","updated":"2016-02-26 08:21:47.000000000","message":"debug will be better","commit_id":"5f28cc4c41a8ceb268bbd08368dd610e87323faa"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"76812f7e32cb5d2bb3efbcf1dec0c82d347ff1e7","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        port_id \u003d plugin.update_port_status(rpc_context, port_id,"},{"line_number":226,"context_line":"                                            n_const.PORT_STATUS_ACTIVE,"},{"line_number":227,"context_line":"                                            host)"},{"line_number":228,"context_line":"        if not port_id:"},{"line_number":229,"context_line":"            LOG.warning("},{"line_number":230,"context_line":"                _LW(\"Failed to update port %(port_id)s with status \""},{"line_number":231,"context_line":"                    \"%(status)s on host %(host)s.\"),"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_fea7214d","line":228,"updated":"2016-02-26 05:24:33.000000000","message":"same here, if the only thing that results in these not returning is the port going away, it\u0027s not a warning condition","commit_id":"5f28cc4c41a8ceb268bbd08368dd610e87323faa"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"267b258db67dc46409b924c6b33850e888a6f0ae","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        port_id \u003d plugin.update_port_status(rpc_context, port_id,"},{"line_number":226,"context_line":"                                            n_const.PORT_STATUS_ACTIVE,"},{"line_number":227,"context_line":"                                            host)"},{"line_number":228,"context_line":"        if not port_id:"},{"line_number":229,"context_line":"            LOG.warning("},{"line_number":230,"context_line":"                _LW(\"Failed to update port %(port_id)s with status \""},{"line_number":231,"context_line":"                    \"%(status)s on host %(host)s.\"),"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aed3d3a_84b043df","line":228,"in_reply_to":"9aed3d3a_fea7214d","updated":"2016-02-26 08:21:47.000000000","message":"Done","commit_id":"5f28cc4c41a8ceb268bbd08368dd610e87323faa"}],"neutron/tests/unit/plugins/ml2/test_db.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ba9d00d6cb6b7b02d4100e97304ac80896747a74","unresolved":false,"context_lines":[{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        port \u003d ml2_db.get_locked_port(self.ctx.session,"},{"line_number":272,"context_line":"                                      port_id)"},{"line_number":273,"context_line":"        self.assertIsNone(port)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"class Ml2DvrDBTestCase(testlib_api.SqlTestCase):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_38d1b3ce","line":273,"updated":"2016-04-04 14:18:48.000000000","message":"could we try to get it locked twice, and verify it fails?","commit_id":"b152842979d0e970c3592af5038fd61ba98746e2"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"8977f793c66558b96855ae280efd3f47c91fc8f7","unresolved":false,"context_lines":[{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        port \u003d ml2_db.get_locked_port(self.ctx.session,"},{"line_number":272,"context_line":"                                      port_id)"},{"line_number":273,"context_line":"        self.assertIsNone(port)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"class Ml2DvrDBTestCase(testlib_api.SqlTestCase):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a061dce_04738981","line":273,"in_reply_to":"9a061dce_38d1b3ce","updated":"2016-04-05 07:20:40.000000000","message":"Removed.","commit_id":"b152842979d0e970c3592af5038fd61ba98746e2"}]}
