)]}'
{"neutron/db/securitygroups_db.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0d772df96e3e31f0f846e46258fe6c5a86584fd7","unresolved":false,"context_lines":[{"line_number":648,"context_line":"    def _ensure_default_security_group(self, context, tenant_id):"},{"line_number":649,"context_line":"        \"\"\"Create a default security group if one doesn\u0027t exist."},{"line_number":650,"context_line":""},{"line_number":651,"context_line":"        MUST be called outside of any transaction."},{"line_number":652,"context_line":"        :returns: the default security group id."},{"line_number":653,"context_line":"        \"\"\""},{"line_number":654,"context_line":"        query \u003d self._model_query(context, DefaultSecurityGroup)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_1baeb02e","line":651,"updated":"2015-07-20 15:31:55.000000000","message":"can we verify there is no opened transaction at this point? (by inspecting context somehow)","commit_id":"9b673a1c9427cee830c2907fdc6d835bc8ac4ab4"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"f40274ccbfe4ba6913657c0000f7a251f3ced406","unresolved":false,"context_lines":[{"line_number":648,"context_line":"    def _ensure_default_security_group(self, context, tenant_id):"},{"line_number":649,"context_line":"        \"\"\"Create a default security group if one doesn\u0027t exist."},{"line_number":650,"context_line":""},{"line_number":651,"context_line":"        MUST be called outside of any transaction."},{"line_number":652,"context_line":"        :returns: the default security group id."},{"line_number":653,"context_line":"        \"\"\""},{"line_number":654,"context_line":"        query \u003d self._model_query(context, DefaultSecurityGroup)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_ce738fe6","line":651,"in_reply_to":"3a50d1a3_1baeb02e","updated":"2015-07-21 01:26:04.000000000","message":"changing the approach","commit_id":"9b673a1c9427cee830c2907fdc6d835bc8ac4ab4"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0d772df96e3e31f0f846e46258fe6c5a86584fd7","unresolved":false,"context_lines":[{"line_number":652,"context_line":"        :returns: the default security group id."},{"line_number":653,"context_line":"        \"\"\""},{"line_number":654,"context_line":"        query \u003d self._model_query(context, DefaultSecurityGroup)"},{"line_number":655,"context_line":"        # the next loop should do 2 iterations at max"},{"line_number":656,"context_line":"        while True:"},{"line_number":657,"context_line":"            try:"},{"line_number":658,"context_line":"                default_group \u003d query.filter_by(tenant_id\u003dtenant_id).one()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_dbd84820","line":655,"updated":"2015-07-20 15:31:55.000000000","message":"this contradicts with bug description ;)","commit_id":"9b673a1c9427cee830c2907fdc6d835bc8ac4ab4"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"f40274ccbfe4ba6913657c0000f7a251f3ced406","unresolved":false,"context_lines":[{"line_number":652,"context_line":"        :returns: the default security group id."},{"line_number":653,"context_line":"        \"\"\""},{"line_number":654,"context_line":"        query \u003d self._model_query(context, DefaultSecurityGroup)"},{"line_number":655,"context_line":"        # the next loop should do 2 iterations at max"},{"line_number":656,"context_line":"        while True:"},{"line_number":657,"context_line":"            try:"},{"line_number":658,"context_line":"                default_group \u003d query.filter_by(tenant_id\u003dtenant_id).one()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_ae7883c5","line":655,"in_reply_to":"3a50d1a3_dbd84820","updated":"2015-07-21 01:26:04.000000000","message":"Done","commit_id":"9b673a1c9427cee830c2907fdc6d835bc8ac4ab4"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0d772df96e3e31f0f846e46258fe6c5a86584fd7","unresolved":false,"context_lines":[{"line_number":653,"context_line":"        \"\"\""},{"line_number":654,"context_line":"        query \u003d self._model_query(context, DefaultSecurityGroup)"},{"line_number":655,"context_line":"        # the next loop should do 2 iterations at max"},{"line_number":656,"context_line":"        while True:"},{"line_number":657,"context_line":"            try:"},{"line_number":658,"context_line":"                default_group \u003d query.filter_by(tenant_id\u003dtenant_id).one()"},{"line_number":659,"context_line":"            except exc.NoResultFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_9b1720a3","line":656,"updated":"2015-07-20 15:31:55.000000000","message":"I think we should remove dangerous while True loop","commit_id":"9b673a1c9427cee830c2907fdc6d835bc8ac4ab4"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"f40274ccbfe4ba6913657c0000f7a251f3ced406","unresolved":false,"context_lines":[{"line_number":653,"context_line":"        \"\"\""},{"line_number":654,"context_line":"        query \u003d self._model_query(context, DefaultSecurityGroup)"},{"line_number":655,"context_line":"        # the next loop should do 2 iterations at max"},{"line_number":656,"context_line":"        while True:"},{"line_number":657,"context_line":"            try:"},{"line_number":658,"context_line":"                default_group \u003d query.filter_by(tenant_id\u003dtenant_id).one()"},{"line_number":659,"context_line":"            except exc.NoResultFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_2e647320","line":656,"in_reply_to":"3a50d1a3_9b1720a3","updated":"2015-07-21 01:26:04.000000000","message":"I\u0027m changing to for i in (0, 1), but that in turn would require some handling of  going out of the loop. that would look a  bit ugly since we know that it _must_ be unreachable code, but have no guarantees in the code itself.","commit_id":"9b673a1c9427cee830c2907fdc6d835bc8ac4ab4"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"24f9c8b1ba391642643899cc7a3c68f35f8a95c0","unresolved":false,"context_lines":[{"line_number":653,"context_line":"        \"\"\""},{"line_number":654,"context_line":"        query \u003d self._model_query(context, DefaultSecurityGroup)"},{"line_number":655,"context_line":"        # the next loop should do 2 iterations at max"},{"line_number":656,"context_line":"        while True:"},{"line_number":657,"context_line":"            try:"},{"line_number":658,"context_line":"                default_group \u003d query.filter_by(tenant_id\u003dtenant_id).one()"},{"line_number":659,"context_line":"            except exc.NoResultFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_acc42440","line":656,"in_reply_to":"3a50d1a3_9b1720a3","updated":"2015-07-20 16:09:24.000000000","message":"agreed.\n\nDBDuplicateEntry should be returned to the caller and the caller should decide if the transaction should be restarted. If the id got from _ensure_default_security_group is not used by the caller (like in most cases) then the caller can simply ignore the DBDuplicateEntry exception and go on. Only _ensure_default_security_group_on_port (it\u0027s the only place where the sec group id got from this method is actually used) should retry the operation.","commit_id":"9b673a1c9427cee830c2907fdc6d835bc8ac4ab4"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"f40274ccbfe4ba6913657c0000f7a251f3ced406","unresolved":false,"context_lines":[{"line_number":653,"context_line":"        \"\"\""},{"line_number":654,"context_line":"        query \u003d self._model_query(context, DefaultSecurityGroup)"},{"line_number":655,"context_line":"        # the next loop should do 2 iterations at max"},{"line_number":656,"context_line":"        while True:"},{"line_number":657,"context_line":"            try:"},{"line_number":658,"context_line":"                default_group \u003d query.filter_by(tenant_id\u003dtenant_id).one()"},{"line_number":659,"context_line":"            except exc.NoResultFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_4ec0dfe0","line":656,"in_reply_to":"3a50d1a3_acc42440","updated":"2015-07-21 01:26:04.000000000","message":"No, I actually don\u0027t think anything should be returned to the caller, especially if the caller is create_network API call, so retrying is justified here. This should have really executed only twice at most and current behavior is just a flaw in assumptions (tx isolation level snapshotting the first result of each query)","commit_id":"9b673a1c9427cee830c2907fdc6d835bc8ac4ab4"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"0d772df96e3e31f0f846e46258fe6c5a86584fd7","unresolved":false,"context_lines":[{"line_number":663,"context_line":"                         \u0027tenant_id\u0027: tenant_id,"},{"line_number":664,"context_line":"                         \u0027description\u0027: _(\u0027Default security group\u0027)}"},{"line_number":665,"context_line":"                }"},{"line_number":666,"context_line":"                try:"},{"line_number":667,"context_line":"                    with db_api.autonested_transaction(context.session):"},{"line_number":668,"context_line":"                        ret \u003d self.create_security_group("},{"line_number":669,"context_line":"                            context, security_group, default_sg\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_fb6d0433","line":666,"updated":"2015-07-20 15:31:55.000000000","message":"since should be called outside of transaction do we still need nested here?","commit_id":"9b673a1c9427cee830c2907fdc6d835bc8ac4ab4"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"f40274ccbfe4ba6913657c0000f7a251f3ced406","unresolved":false,"context_lines":[{"line_number":663,"context_line":"                         \u0027tenant_id\u0027: tenant_id,"},{"line_number":664,"context_line":"                         \u0027description\u0027: _(\u0027Default security group\u0027)}"},{"line_number":665,"context_line":"                }"},{"line_number":666,"context_line":"                try:"},{"line_number":667,"context_line":"                    with db_api.autonested_transaction(context.session):"},{"line_number":668,"context_line":"                        ret \u003d self.create_security_group("},{"line_number":669,"context_line":"                            context, security_group, default_sg\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_6e827b96","line":666,"in_reply_to":"3a50d1a3_fb6d0433","updated":"2015-07-21 01:26:04.000000000","message":"no","commit_id":"9b673a1c9427cee830c2907fdc6d835bc8ac4ab4"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f0d92d2eafa914ef88ec11bb226cde659d04c49f","unresolved":false,"context_lines":[{"line_number":658,"context_line":"        context \u003d ncontext.get_admin_context()"},{"line_number":659,"context_line":"        query \u003d self._model_query(context, DefaultSecurityGroup)"},{"line_number":660,"context_line":""},{"line_number":661,"context_line":"        for i in xrange(2):"},{"line_number":662,"context_line":"            try:"},{"line_number":663,"context_line":"                default_group \u003d query.filter_by(tenant_id\u003dtenant_id).one()"},{"line_number":664,"context_line":"            except exc.NoResultFound:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_65c051e1","line":661,"updated":"2015-07-21 06:39:44.000000000","message":"xrange is not py3 compatible","commit_id":"4bbe2b289fe6384d550cfe4d23802e0e27b01d1d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"f0d92d2eafa914ef88ec11bb226cde659d04c49f","unresolved":false,"context_lines":[{"line_number":673,"context_line":"                        ret \u003d self.create_security_group("},{"line_number":674,"context_line":"                            context, security_group, default_sg\u003dTrue)"},{"line_number":675,"context_line":"                except exception.DBDuplicateEntry as ex:"},{"line_number":676,"context_line":"                    LOG.debug(\"Duplicate default security group %s was \""},{"line_number":677,"context_line":"                              \"not created\", ex.value)"},{"line_number":678,"context_line":"                else:"},{"line_number":679,"context_line":"                    return ret[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a50d1a3_40de6312","line":676,"updated":"2015-07-21 06:39:44.000000000","message":"Have you considered using db retry approach? We can raise retry request and restart the whole parent transaction, thus no need for new context, weird 2 iterations loop and all the explanations in comments. I believe all high level methods which use this one are already wrapped with db_retry. It\u0027s quite a rare case so some loss in performance is justified IMO","commit_id":"4bbe2b289fe6384d550cfe4d23802e0e27b01d1d"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"a777b629f63fd3201b0a431870cea995bdaeea8a","unresolved":false,"context_lines":[{"line_number":650,"context_line":""},{"line_number":651,"context_line":"        :returns: the default security group id for given tenant."},{"line_number":652,"context_line":"        \"\"\""},{"line_number":653,"context_line":"        for x in range(2):"},{"line_number":654,"context_line":"            try:"},{"line_number":655,"context_line":"                query \u003d self._model_query(context, DefaultSecurityGroup)"},{"line_number":656,"context_line":"                default_group \u003d query.filter_by(tenant_id\u003dtenant_id).one()"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_e32d4ba9","line":653,"updated":"2015-07-31 04:32:15.000000000","message":"why do you still want to loop?\n\nit\u0027s simpler to raise RetryRequest on DBDuplicateEntry.\nthat way we can get rid of the nested transaction too.","commit_id":"b5bb877e2fc69bc05529840cfa86a1544d4c1e20"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"63af62f3946b435f04e020cdadeab85ac0bd50f2","unresolved":false,"context_lines":[{"line_number":650,"context_line":""},{"line_number":651,"context_line":"        :returns: the default security group id for given tenant."},{"line_number":652,"context_line":"        \"\"\""},{"line_number":653,"context_line":"        for x in range(2):"},{"line_number":654,"context_line":"            try:"},{"line_number":655,"context_line":"                query \u003d self._model_query(context, DefaultSecurityGroup)"},{"line_number":656,"context_line":"                default_group \u003d query.filter_by(tenant_id\u003dtenant_id).one()"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_c8c4e742","line":653,"in_reply_to":"3a50d1a3_e32d4ba9","updated":"2015-07-31 07:51:47.000000000","message":"We don\u0027t need to retry if we\u0027re not inside a transaction, it is possible that caller is not wrapped with db_retry at all in this case.\nAlso without nested transaction we won\u0027t catch DBDuplicateEntry at 678.","commit_id":"b5bb877e2fc69bc05529840cfa86a1544d4c1e20"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"dee45da60ee4b58b1143bea9863e3796ab72be01","unresolved":false,"context_lines":[{"line_number":651,"context_line":"        :returns: the default security group id."},{"line_number":652,"context_line":"        \"\"\""},{"line_number":653,"context_line":"        query \u003d self._model_query(context, DefaultSecurityGroup)"},{"line_number":654,"context_line":"        # the next loop should do 2 iterations at max"},{"line_number":655,"context_line":"        while True:"},{"line_number":656,"context_line":"            try:"},{"line_number":657,"context_line":"                default_group \u003d query.filter_by(tenant_id\u003dtenant_id).one()"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_15b5b52f","side":"PARENT","line":654,"updated":"2015-08-20 00:38:55.000000000","message":"nit: mind moving this comment above the for loop. And maybe update the comment to say 2 attempts other wise the 2 just looks like a magic number. Also could we set 2 to be db_api.MAX_RETRIE instread?","commit_id":"e0999554a49408b0fc435308c1cf071cbd9ff310"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c701a9b0e99c5fb53c952695ef554091e0976c7d","unresolved":false,"context_lines":[{"line_number":651,"context_line":"        :returns: the default security group id."},{"line_number":652,"context_line":"        \"\"\""},{"line_number":653,"context_line":"        query \u003d self._model_query(context, DefaultSecurityGroup)"},{"line_number":654,"context_line":"        # the next loop should do 2 iterations at max"},{"line_number":655,"context_line":"        while True:"},{"line_number":656,"context_line":"            try:"},{"line_number":657,"context_line":"                default_group \u003d query.filter_by(tenant_id\u003dtenant_id).one()"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_e91e28ba","side":"PARENT","line":654,"in_reply_to":"fa1b9901_15b5b52f","updated":"2015-08-20 03:06:40.000000000","message":"I made a tweak, not sure if it\u0027s what you\u0027re looking for.","commit_id":"e0999554a49408b0fc435308c1cf071cbd9ff310"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"78f7ff47783a7ee4561b0b410ef36e6ba2100bff","unresolved":false,"context_lines":[{"line_number":664,"context_line":"                    # not seeing this group we\u0027re most probably inside a"},{"line_number":665,"context_line":"                    # transaction with REPEATABLE READ isolation level -\u003e"},{"line_number":666,"context_line":"                    # need to restart the whole transaction"},{"line_number":667,"context_line":"                    raise db_exc.RetryRequest(ex)"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"                security_group \u003d {"},{"line_number":670,"context_line":"                    \u0027security_group\u0027:"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa1b9901_35ab0e77","line":667,"updated":"2015-08-20 07:23:39.000000000","message":"this won\u0027t work as expected if caller is not wrapped with db_retry(retry_on_request\u003dTrue)","commit_id":"11281251d79abdd59df8120b07f3e4196ed9b884"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"24f9c8b1ba391642643899cc7a3c68f35f8a95c0","unresolved":false,"context_lines":[{"line_number":968,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":969,"context_line":"            dhcp_opts \u003d attrs.get(edo_ext.EXTRADHCPOPTS, [])"},{"line_number":970,"context_line":"            result \u003d super(Ml2Plugin, self).create_port(context, port)"},{"line_number":971,"context_line":"            self.extension_manager.process_create_port(context, attrs, result)"},{"line_number":972,"context_line":"            self._portsec_ext_port_create_processing(context, result, port)"},{"line_number":973,"context_line":""},{"line_number":974,"context_line":"            # sgids must be got after portsec checked with security group"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_91bb7fc4","line":971,"updated":"2015-07-20 16:09:24.000000000","message":"you potentially have the same problem here","commit_id":"9b673a1c9427cee830c2907fdc6d835bc8ac4ab4"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"f40274ccbfe4ba6913657c0000f7a251f3ced406","unresolved":false,"context_lines":[{"line_number":968,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":969,"context_line":"            dhcp_opts \u003d attrs.get(edo_ext.EXTRADHCPOPTS, [])"},{"line_number":970,"context_line":"            result \u003d super(Ml2Plugin, self).create_port(context, port)"},{"line_number":971,"context_line":"            self.extension_manager.process_create_port(context, attrs, result)"},{"line_number":972,"context_line":"            self._portsec_ext_port_create_processing(context, result, port)"},{"line_number":973,"context_line":""},{"line_number":974,"context_line":"            # sgids must be got after portsec checked with security group"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_83f8004b","line":971,"in_reply_to":"3a50d1a3_91bb7fc4","updated":"2015-07-21 01:26:04.000000000","message":"hmm, considering that port is created for the network, which creates the default sg, is your statement still true?\n\nbut anyway, this makes me think that it\u0027s better to take approach #2 - we\u0027ll create separate context for the method, so it will not intersect with any parent transactions.","commit_id":"9b673a1c9427cee830c2907fdc6d835bc8ac4ab4"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"a777b629f63fd3201b0a431870cea995bdaeea8a","unresolved":false,"context_lines":[{"line_number":954,"context_line":"            raise psec.PortSecurityAndIPRequiredForSecurityGroups()"},{"line_number":955,"context_line":""},{"line_number":956,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":957,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":958,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":959,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":960,"context_line":"        if not attrs.get(\u0027status\u0027):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_c31b6f7f","line":957,"updated":"2015-07-31 04:32:15.000000000","message":"how about other plugins?","commit_id":"b5bb877e2fc69bc05529840cfa86a1544d4c1e20"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"c6b67d713d162067d1a9ca2ca00d0763a3a20d63","unresolved":false,"context_lines":[{"line_number":954,"context_line":"            raise psec.PortSecurityAndIPRequiredForSecurityGroups()"},{"line_number":955,"context_line":""},{"line_number":956,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":957,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":958,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":959,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":960,"context_line":"        if not attrs.get(\u0027status\u0027):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_b43472fb","line":957,"in_reply_to":"1a4dcd0f_9477f607","updated":"2015-08-14 09:58:27.000000000","message":"in case of repeatable read, sure.  but it isn\u0027t necessary the case.","commit_id":"b5bb877e2fc69bc05529840cfa86a1544d4c1e20"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"b733b3f622de40ceed5d5762c0725d4a46682e7c","unresolved":false,"context_lines":[{"line_number":954,"context_line":"            raise psec.PortSecurityAndIPRequiredForSecurityGroups()"},{"line_number":955,"context_line":""},{"line_number":956,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":957,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":958,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":959,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":960,"context_line":"        if not attrs.get(\u0027status\u0027):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_d77c9bb7","line":957,"in_reply_to":"1a4dcd0f_b43472fb","updated":"2015-08-14 12:06:32.000000000","message":"What migth be other cases when there is no object in db initially, then we get db duplicate error on attempt to add it but still don\u0027t see it in db?","commit_id":"b5bb877e2fc69bc05529840cfa86a1544d4c1e20"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"dc4a52c92bba03f237e68e9d7040e3f5425ff8f5","unresolved":false,"context_lines":[{"line_number":954,"context_line":"            raise psec.PortSecurityAndIPRequiredForSecurityGroups()"},{"line_number":955,"context_line":""},{"line_number":956,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":957,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":958,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":959,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":960,"context_line":"        if not attrs.get(\u0027status\u0027):"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa1b9901_a4d2955a","line":957,"in_reply_to":"1a4dcd0f_d77c9bb7","updated":"2015-08-20 03:28:38.000000000","message":"can\u0027t it be removed behind us?  not likely, though.","commit_id":"b5bb877e2fc69bc05529840cfa86a1544d4c1e20"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"1b93b00e955336b3aff1ea6ac4cb1201aff3ede0","unresolved":false,"context_lines":[{"line_number":954,"context_line":"            raise psec.PortSecurityAndIPRequiredForSecurityGroups()"},{"line_number":955,"context_line":""},{"line_number":956,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":957,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":958,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":959,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":960,"context_line":"        if not attrs.get(\u0027status\u0027):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_9477f607","line":957,"in_reply_to":"1a4dcd0f_f9a51347","updated":"2015-08-14 09:53:53.000000000","message":"I think we can\u0027t be sure that all other plugins follow the same logic. Ready to update the wiki once the patch is merged. I\u0027d not consider it as an API breakage though: in fact it makes things better in the end, with this change an unhandled RetryRequest will be thrown in the worst case, without the change - infinite loop","commit_id":"b5bb877e2fc69bc05529840cfa86a1544d4c1e20"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"0caf799ed7f14767db009cdb8d7d9d46646d7ce5","unresolved":false,"context_lines":[{"line_number":954,"context_line":"            raise psec.PortSecurityAndIPRequiredForSecurityGroups()"},{"line_number":955,"context_line":""},{"line_number":956,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":957,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":958,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":959,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":960,"context_line":"        if not attrs.get(\u0027status\u0027):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_54072e18","line":957,"in_reply_to":"1a4dcd0f_f9a51347","updated":"2015-08-14 09:39:37.000000000","message":"s/look as/look same as/","commit_id":"b5bb877e2fc69bc05529840cfa86a1544d4c1e20"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"486b651c74ffa261bfdd418f13c6141f2792367b","unresolved":false,"context_lines":[{"line_number":954,"context_line":"            raise psec.PortSecurityAndIPRequiredForSecurityGroups()"},{"line_number":955,"context_line":""},{"line_number":956,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":957,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":958,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":959,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":960,"context_line":"        if not attrs.get(\u0027status\u0027):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_de490462","line":957,"in_reply_to":"3a50d1a3_c31b6f7f","updated":"2015-07-31 04:37:41.000000000","message":"I think the approach we should be taking is to remove sg creation out of transaction completely.","commit_id":"b5bb877e2fc69bc05529840cfa86a1544d4c1e20"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"63af62f3946b435f04e020cdadeab85ac0bd50f2","unresolved":false,"context_lines":[{"line_number":954,"context_line":"            raise psec.PortSecurityAndIPRequiredForSecurityGroups()"},{"line_number":955,"context_line":""},{"line_number":956,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":957,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":958,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":959,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":960,"context_line":"        if not attrs.get(\u0027status\u0027):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_e80d23e9","line":957,"in_reply_to":"3a50d1a3_c31b6f7f","updated":"2015-07-31 07:51:47.000000000","message":"Other plugins may likely have different logic and not have such problem at all. It\u0027s hard to go and fix every plugin with respect to creation default security group. I\u0027d follow \u0027on demand\u0027 tactic in fixing such things.","commit_id":"b5bb877e2fc69bc05529840cfa86a1544d4c1e20"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"52be1e94d7e7fff1c55f17895750b73ac9ce46ad","unresolved":false,"context_lines":[{"line_number":954,"context_line":"            raise psec.PortSecurityAndIPRequiredForSecurityGroups()"},{"line_number":955,"context_line":""},{"line_number":956,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":957,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":958,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":959,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":960,"context_line":"        if not attrs.get(\u0027status\u0027):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a4dcd0f_f9a51347","line":957,"in_reply_to":"3a50d1a3_e80d23e9","updated":"2015-08-14 09:37:06.000000000","message":"i wonder where your guess was come from.\ni looked at networking-nec and networking-midonet.\nthey look as ml2 in this regard.\n\nhow about documenting this somewhere for plugin maintainers?\neg. https://wiki.openstack.org/wiki/Neutron/LibraryAPIBreakage","commit_id":"b5bb877e2fc69bc05529840cfa86a1544d4c1e20"},{"author":{"_account_id":7018,"name":"Abhishek Raut","email":"rauta@vmware.com","username":"abhiraut"},"change_message_id":"b9884ac44f483b2f32b85d5f253d5ebb4c6e4c73","unresolved":false,"context_lines":[{"line_number":614,"context_line":"                result[api.MTU] \u003d res.get(api.MTU, 0)"},{"line_number":615,"context_line":""},{"line_number":616,"context_line":"        return result, mech_context"},{"line_number":617,"context_line":""},{"line_number":618,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":619,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":620,"context_line":"    def _create_network_with_retries(self, context, network):"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_1f739616","line":617,"updated":"2015-08-20 00:07:26.000000000","message":"maybe out of scope... but then this also is not needed i guess","commit_id":"465c90f9105fa9ab3284154a54c51a81654bed0f"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c701a9b0e99c5fb53c952695ef554091e0976c7d","unresolved":false,"context_lines":[{"line_number":614,"context_line":"                result[api.MTU] \u003d res.get(api.MTU, 0)"},{"line_number":615,"context_line":""},{"line_number":616,"context_line":"        return result, mech_context"},{"line_number":617,"context_line":""},{"line_number":618,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":619,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":620,"context_line":"    def _create_network_with_retries(self, context, network):"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_e99dc866","line":617,"in_reply_to":"fa1b9901_1f739616","updated":"2015-08-20 03:06:40.000000000","message":"I don\u0027t think create network is called from RPC?","commit_id":"465c90f9105fa9ab3284154a54c51a81654bed0f"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"e51627df632d939a474184d73ac649f947c929b3","unresolved":false,"context_lines":[{"line_number":963,"context_line":"            raise psec.PortSecurityAndIPRequiredForSecurityGroups()"},{"line_number":964,"context_line":""},{"line_number":965,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":966,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":967,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":968,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":969,"context_line":"        if not attrs.get(\u0027status\u0027):"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_dfdafe4b","line":966,"updated":"2015-08-19 23:40:17.000000000","message":"Not sure if we need this now that we have https://review.openstack.org/207532","commit_id":"465c90f9105fa9ab3284154a54c51a81654bed0f"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"2281d4c8955cb6dde3a11908a55687dbfac3812f","unresolved":false,"context_lines":[{"line_number":963,"context_line":"            raise psec.PortSecurityAndIPRequiredForSecurityGroups()"},{"line_number":964,"context_line":""},{"line_number":965,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":966,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":967,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":968,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":969,"context_line":"        if not attrs.get(\u0027status\u0027):"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_fa61053a","line":966,"in_reply_to":"fa1b9901_dfdafe4b","updated":"2015-08-20 07:07:34.000000000","message":"retry_on_request and retry_on_deadlock are different things, so we need this","commit_id":"465c90f9105fa9ab3284154a54c51a81654bed0f"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"8d5b089a23fa207803adb2072197fd86a3b4de2a","unresolved":false,"context_lines":[{"line_number":963,"context_line":"            raise psec.PortSecurityAndIPRequiredForSecurityGroups()"},{"line_number":964,"context_line":""},{"line_number":965,"context_line":"    @oslo_db_api.wrap_db_retry(max_retries\u003ddb_api.MAX_RETRIES,"},{"line_number":966,"context_line":"                               retry_on_request\u003dTrue)"},{"line_number":967,"context_line":"    def _create_port_db(self, context, port):"},{"line_number":968,"context_line":"        attrs \u003d port[attributes.PORT]"},{"line_number":969,"context_line":"        if not attrs.get(\u0027status\u0027):"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_37e22b30","line":966,"in_reply_to":"fa1b9901_fa61053a","updated":"2015-08-20 10:25:30.000000000","message":"Totally missed that distinction, thanks!","commit_id":"465c90f9105fa9ab3284154a54c51a81654bed0f"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"1b172eae1ddb979c3080e6838ee122d7a376e047","unresolved":false,"context_lines":[{"line_number":644,"context_line":""},{"line_number":645,"context_line":"        return result"},{"line_number":646,"context_line":""},{"line_number":647,"context_line":"    def create_network_bulk(self, context, networks):"},{"line_number":648,"context_line":"        objects \u003d self._create_bulk_ml2(attributes.NETWORK, context, networks)"},{"line_number":649,"context_line":"        return [obj[\u0027result\u0027] for obj in objects]"},{"line_number":650,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_ad111206","line":647,"range":{"start_line":647,"start_character":8,"end_line":647,"end_character":27},"updated":"2015-08-20 08:22:39.000000000","message":"doesn\u0027t this need retry_on_request as well?","commit_id":"694b222b558b573ab3e91d6cb2d0e0ca6cd41e9d"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"3a2722999e5f084976015092372a90acffadeca2","unresolved":false,"context_lines":[{"line_number":644,"context_line":""},{"line_number":645,"context_line":"        return result"},{"line_number":646,"context_line":""},{"line_number":647,"context_line":"    def create_network_bulk(self, context, networks):"},{"line_number":648,"context_line":"        objects \u003d self._create_bulk_ml2(attributes.NETWORK, context, networks)"},{"line_number":649,"context_line":"        return [obj[\u0027result\u0027] for obj in objects]"},{"line_number":650,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_a6cccfbb","line":647,"in_reply_to":"fa1b9901_ad111206","updated":"2015-08-20 09:21:36.000000000","message":"That\u0027s a good point, I think we need to wrap _create_bulk_ml2 to be more generic.","commit_id":"694b222b558b573ab3e91d6cb2d0e0ca6cd41e9d"}]}
