)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"0d123d531e00dfa14faf4755203e9b91960093d8","unresolved":false,"context_lines":[{"line_number":11,"context_line":"focuses specifically on the \"port\" handlers."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Partially-Implements: blueprint midonet-plugin-juno"},{"line_number":14,"context_line":"Signed-off-by: Joe Mills \u003cjoe@midokura.com\u003e"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I3e5a87385d9e3f77d9f420a60338db224ce72964"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"baada198_df5a2181","line":14,"updated":"2014-07-25 17:11:09.000000000","message":"nit: this line can be removed","commit_id":"adefd1f393863f6a0dbc8adbb47346c84b55daba"}],"neutron/plugins/midonet/plugin.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"939ee15b4868f0b1b6837978f8feee95d8434cc7","unresolved":false,"context_lines":[{"line_number":391,"context_line":"        LOG.info(_(\"MidonetPluginV2.delete_network exiting: id\u003d%r\"), id)"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"    @handle_api_error"},{"line_number":394,"context_line":"    @utils.synchronized(\u0027port-critical-section\u0027, external\u003dTrue)"},{"line_number":395,"context_line":"    def create_port(self, context, port):"},{"line_number":396,"context_line":"        \"\"\"Create a L2 port in Neutron/MidoNet.\"\"\""},{"line_number":397,"context_line":"        LOG.info(_(\"MidonetPluginV2.create_port called: port\u003d%r\"), port)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_963587f9","line":394,"range":{"start_line":394,"start_character":25,"end_line":394,"end_character":46},"updated":"2014-07-09 02:42:27.000000000","message":"why is this necessary?\n\ncan this be something like \u0027midonet-foo\u0027?","commit_id":"67a5189e1893579daab9932b2e597e6e2042d2e3"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"939ee15b4868f0b1b6837978f8feee95d8434cc7","unresolved":false,"context_lines":[{"line_number":404,"context_line":"            # Make sure that the port created is valid"},{"line_number":405,"context_line":"            if \"id\" not in new_port:"},{"line_number":406,"context_line":"                raise n_exc.BadRequest(resource\u003d\u0027port\u0027,"},{"line_number":407,"context_line":"                                       msg\u003d\"Invalid port created\")"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"            # Update fields"},{"line_number":410,"context_line":"            port_data.update(new_port)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_d648df89","line":407,"updated":"2014-07-09 02:42:27.000000000","message":"can this happen?","commit_id":"67a5189e1893579daab9932b2e597e6e2042d2e3"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"15a9c4609bb7841a73e9ce1dcac2a07e272b5028","unresolved":false,"context_lines":[{"line_number":409,"context_line":""},{"line_number":410,"context_line":"        return new_port"},{"line_number":411,"context_line":""},{"line_number":412,"context_line":"    @handle_api_error"},{"line_number":413,"context_line":"    def create_port(self, context, port):"},{"line_number":414,"context_line":"        \"\"\"Create a L2 port in Neutron/MidoNet.\"\"\""},{"line_number":415,"context_line":"        LOG.info(_(\"MidonetPluginV2.create_port called: port\u003d%r\"), port)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_212e02ac","line":412,"updated":"2014-07-30 21:02:45.000000000","message":"All exceptions from midnetclient are caught at L.421 below. It seems unnecessary.","commit_id":"adefd1f393863f6a0dbc8adbb47346c84b55daba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"0d123d531e00dfa14faf4755203e9b91960093d8","unresolved":false,"context_lines":[{"line_number":412,"context_line":"    @handle_api_error"},{"line_number":413,"context_line":"    def create_port(self, context, port):"},{"line_number":414,"context_line":"        \"\"\"Create a L2 port in Neutron/MidoNet.\"\"\""},{"line_number":415,"context_line":"        LOG.info(_(\"MidonetPluginV2.create_port called: port\u003d%r\"), port)"},{"line_number":416,"context_line":""},{"line_number":417,"context_line":"        new_port \u003d self._process_create_port(context, port)"},{"line_number":418,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_9fcb491d","line":415,"updated":"2014-07-25 17:11:09.000000000","message":"nit: please avoid 2 log statement at info level for the same function. See https://wiki.openstack.org/wiki/LoggingStandards\n\nSame applies to the rest of the patch, I won\u0027t add comments","commit_id":"adefd1f393863f6a0dbc8adbb47346c84b55daba"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"67be05a3f0b0009804d0b8042cda18208a046784","unresolved":false,"context_lines":[{"line_number":417,"context_line":"        new_port \u003d self._process_create_port(context, port)"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"        try:"},{"line_number":420,"context_line":"            self.api_cli.create_port(new_port)"},{"line_number":421,"context_line":"        except Exception as ex:"},{"line_number":422,"context_line":"            LOG.error(_(\"Failed to create a port %(new_port)s: %(err)s\"),"},{"line_number":423,"context_line":"                      {\"new_port\": new_port, \"err\": ex})"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_da8c8138","line":420,"updated":"2014-07-09 05:40:58.000000000","message":"is it intentional to do this call out of the transaction?","commit_id":"adefd1f393863f6a0dbc8adbb47346c84b55daba"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"ec6ddbef61e999eb5043b7115407769908ca75b6","unresolved":false,"context_lines":[{"line_number":417,"context_line":"        new_port \u003d self._process_create_port(context, port)"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"        try:"},{"line_number":420,"context_line":"            self.api_cli.create_port(new_port)"},{"line_number":421,"context_line":"        except Exception as ex:"},{"line_number":422,"context_line":"            LOG.error(_(\"Failed to create a port %(new_port)s: %(err)s\"),"},{"line_number":423,"context_line":"                      {\"new_port\": new_port, \"err\": ex})"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_9d54c322","line":420,"in_reply_to":"baada198_7d19af21","updated":"2014-07-09 06:47:47.000000000","message":"for performance you mean?","commit_id":"adefd1f393863f6a0dbc8adbb47346c84b55daba"},{"author":{"_account_id":8837,"name":"Joe Mills","email":"joe.h.mills@gmail.com","username":"joemido"},"change_message_id":"5936f19bcdc9c9e97ac7948492156d4a7845c0cb","unresolved":false,"context_lines":[{"line_number":417,"context_line":"        new_port \u003d self._process_create_port(context, port)"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"        try:"},{"line_number":420,"context_line":"            self.api_cli.create_port(new_port)"},{"line_number":421,"context_line":"        except Exception as ex:"},{"line_number":422,"context_line":"            LOG.error(_(\"Failed to create a port %(new_port)s: %(err)s\"),"},{"line_number":423,"context_line":"                      {\"new_port\": new_port, \"err\": ex})"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_a9e30932","line":420,"in_reply_to":"baada198_9d54c322","updated":"2014-07-09 08:37:28.000000000","message":"yes, for performance. In addition, if the create_port requests come in at a faster rate than we can process them, eventually some of the requests will start timing out.","commit_id":"adefd1f393863f6a0dbc8adbb47346c84b55daba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"0d123d531e00dfa14faf4755203e9b91960093d8","unresolved":false,"context_lines":[{"line_number":417,"context_line":"        new_port \u003d self._process_create_port(context, port)"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"        try:"},{"line_number":420,"context_line":"            self.api_cli.create_port(new_port)"},{"line_number":421,"context_line":"        except Exception as ex:"},{"line_number":422,"context_line":"            LOG.error(_(\"Failed to create a port %(new_port)s: %(err)s\"),"},{"line_number":423,"context_line":"                      {\"new_port\": new_port, \"err\": ex})"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_7fc67517","line":420,"in_reply_to":"baada198_a9e30932","updated":"2014-07-25 17:11:09.000000000","message":"I like this approach, if you apply it to all the other methods you will see a performance improvement overall I think.","commit_id":"adefd1f393863f6a0dbc8adbb47346c84b55daba"},{"author":{"_account_id":8837,"name":"Joe Mills","email":"joe.h.mills@gmail.com","username":"joemido"},"change_message_id":"4593156b4836458ae9a693ce2b6022e2cdff206b","unresolved":false,"context_lines":[{"line_number":417,"context_line":"        new_port \u003d self._process_create_port(context, port)"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"        try:"},{"line_number":420,"context_line":"            self.api_cli.create_port(new_port)"},{"line_number":421,"context_line":"        except Exception as ex:"},{"line_number":422,"context_line":"            LOG.error(_(\"Failed to create a port %(new_port)s: %(err)s\"),"},{"line_number":423,"context_line":"                      {\"new_port\": new_port, \"err\": ex})"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_7d19af21","line":420,"in_reply_to":"baada198_da8c8138","updated":"2014-07-09 06:19:30.000000000","message":"Hi Takashi, I should have mentioned this previously, sorry about that: This is intentional. Although we want to have most of our midonet api calls within the transaction, we are making an exception for create_port because we have seen issues with create_port being called more frequently than other device creation calls.","commit_id":"adefd1f393863f6a0dbc8adbb47346c84b55daba"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"0d123d531e00dfa14faf4755203e9b91960093d8","unresolved":false,"context_lines":[{"line_number":442,"context_line":""},{"line_number":443,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":444,"context_line":"            super(MidonetPluginV2, self).disassociate_floatingips(context, id)"},{"line_number":445,"context_line":"            super(MidonetPluginV2, self).delete_port(context, id)"},{"line_number":446,"context_line":"            self.api_cli.delete_port(id)"},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"        LOG.info(_(\"MidonetPluginV2.delete_port exiting: id\u003d%r\"), id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_dfb6a188","line":445,"updated":"2014-07-25 17:11:09.000000000","message":"Same as suggested for your patch https://review.openstack.org/#/c/103820 Consider moving the api_cli call outside the transaction and use a try/except to catch a MidonetApiException and revert the DB manually\n\nI\u0027d suggest the same everywhere","commit_id":"adefd1f393863f6a0dbc8adbb47346c84b55daba"}]}
