)]}'
{"neutron/db/segments_db.py":[{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"8d4234ea57265d244176611a8686781331f5fe28","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        context.session.add(record)"},{"line_number":79,"context_line":"        registry.notify(resources.SEGMENT,"},{"line_number":80,"context_line":"                        events.PRECOMMIT_CREATE,"},{"line_number":81,"context_line":"                        trigger\u003dNone,"},{"line_number":82,"context_line":"                        context\u003dcontext,"},{"line_number":83,"context_line":"                        segment\u003drecord)"},{"line_number":84,"context_line":"        segment[\u0027id\u0027] \u003d record.id"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_3a5fda76","line":81,"range":{"start_line":81,"start_character":32,"end_line":81,"end_character":36},"updated":"2016-06-28 02:15:08.000000000","message":"I think the trigger could be the function here, althrough it will not be used by consumer.","commit_id":"4d7973c21118852cce946059823c58c7acfb7fc8"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"53ebac5495a44165fb062034714dde47e1ee6e33","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        context.session.add(record)"},{"line_number":79,"context_line":"        registry.notify(resources.SEGMENT,"},{"line_number":80,"context_line":"                        events.PRECOMMIT_CREATE,"},{"line_number":81,"context_line":"                        trigger\u003dNone,"},{"line_number":82,"context_line":"                        context\u003dcontext,"},{"line_number":83,"context_line":"                        segment\u003drecord)"},{"line_number":84,"context_line":"        segment[\u0027id\u0027] \u003d record.id"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_70df130d","line":81,"range":{"start_line":81,"start_character":32,"end_line":81,"end_character":36},"in_reply_to":"3aaa91ec_3a5fda76","updated":"2016-06-30 20:24:11.000000000","message":"ok, sounds good.  The registry code isn\u0027t really clear about what kind of thing the trigger is supposed to be.  Most of them are instances of some class but obviously that doesn\u0027t apply here.","commit_id":"4d7973c21118852cce946059823c58c7acfb7fc8"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"2e1f84303968afc082483534600f2f818f028715","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def add_network_segment(context, network_id, segment, segment_index\u003d0,"},{"line_number":67,"context_line":"                        is_dynamic\u003dFalse):"},{"line_number":68,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":69,"context_line":"        record \u003d NetworkSegment("},{"line_number":70,"context_line":"            id\u003duuidutils.generate_uuid(),"},{"line_number":71,"context_line":"            network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_940365b8","line":68,"range":{"start_line":68,"start_character":9,"end_line":68,"end_character":52},"updated":"2016-07-02 07:42:58.000000000","message":"Maybe use \u0027neutron.db.api.autonested_transaction\u0027 instead?","commit_id":"040d740d20f268938bbbca06b41006331f0ee889"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"b57a5df8f3619790dadbfcb6798a923627be7567","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def add_network_segment(context, network_id, segment, segment_index\u003d0,"},{"line_number":67,"context_line":"                        is_dynamic\u003dFalse):"},{"line_number":68,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":69,"context_line":"        record \u003d NetworkSegment("},{"line_number":70,"context_line":"            id\u003duuidutils.generate_uuid(),"},{"line_number":71,"context_line":"            network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_0d6fe32b","line":68,"updated":"2016-07-12 00:22:56.000000000","message":"We should only use autonested transaction if we have a need to catch errors in the middle of another transaction. I don\u0027t see that we need that so it\u0027s not something we should adopt until that\u0027s a requirement.","commit_id":"040d740d20f268938bbbca06b41006331f0ee889"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"7d02900732a98db4b4e237249c9eb79085882c43","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def add_network_segment(context, network_id, segment, segment_index\u003d0,"},{"line_number":67,"context_line":"                        is_dynamic\u003dFalse):"},{"line_number":68,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":69,"context_line":"        record \u003d NetworkSegment("},{"line_number":70,"context_line":"            id\u003duuidutils.generate_uuid(),"},{"line_number":71,"context_line":"            network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_9328e434","line":68,"range":{"start_line":68,"start_character":9,"end_line":68,"end_character":52},"in_reply_to":"1aa78d24_73f782f5","updated":"2016-07-06 22:21:20.000000000","message":"It is not really worth a patch. I just thought that we could change \u0027session.begin\u0027 to \u0027autonested_transaction\u0027 here since this patch affects this line anyway (should have added \"nit:\" to the comment).","commit_id":"040d740d20f268938bbbca06b41006331f0ee889"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"82b4aef0501c8e7709a64e4e2eaab934356741e0","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def add_network_segment(context, network_id, segment, segment_index\u003d0,"},{"line_number":67,"context_line":"                        is_dynamic\u003dFalse):"},{"line_number":68,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":69,"context_line":"        record \u003d NetworkSegment("},{"line_number":70,"context_line":"            id\u003duuidutils.generate_uuid(),"},{"line_number":71,"context_line":"            network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_e5d5f142","line":68,"range":{"start_line":68,"start_character":9,"end_line":68,"end_character":52},"in_reply_to":"1aa78d24_9328e434","updated":"2016-07-07 15:46:17.000000000","message":"I\u0027m pretty firm against changing unrelated things in a patch set.  It complicates merges, reverts, cherry-picks and the like.  It also confuses reviewers.","commit_id":"040d740d20f268938bbbca06b41006331f0ee889"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4481cfc51b9192c041e644a703ac534f54a2cc5f","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"def add_network_segment(context, network_id, segment, segment_index\u003d0,"},{"line_number":67,"context_line":"                        is_dynamic\u003dFalse):"},{"line_number":68,"context_line":"    with context.session.begin(subtransactions\u003dTrue):"},{"line_number":69,"context_line":"        record \u003d NetworkSegment("},{"line_number":70,"context_line":"            id\u003duuidutils.generate_uuid(),"},{"line_number":71,"context_line":"            network_id\u003dnetwork_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_73f782f5","line":68,"range":{"start_line":68,"start_character":9,"end_line":68,"end_character":52},"in_reply_to":"1aa78d24_940365b8","updated":"2016-07-06 20:53:21.000000000","message":"It doesn\u0027t look like this comment is related directly to this change.  If you think this needs to be done, propose a patch independently.","commit_id":"040d740d20f268938bbbca06b41006331f0ee889"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"b57a5df8f3619790dadbfcb6798a923627be7567","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                        events.PRECOMMIT_CREATE,"},{"line_number":81,"context_line":"                        trigger\u003dadd_network_segment,"},{"line_number":82,"context_line":"                        context\u003dcontext,"},{"line_number":83,"context_line":"                        segment\u003drecord)"},{"line_number":84,"context_line":"        segment[\u0027id\u0027] \u003d record.id"},{"line_number":85,"context_line":"    LOG.info(_LI(\"Added segment %(id)s of type %(network_type)s for network \""},{"line_number":86,"context_line":"                 \"%(network_id)s\"),"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_ed6b771c","line":83,"updated":"2016-07-12 00:22:56.000000000","message":"+1 to not flush call because in galera deployments we wouldn\u0027t error until the commit either way. I prefer to keep behavior the same between galera and single node as much as possible.","commit_id":"040d740d20f268938bbbca06b41006331f0ee889"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"2e1f84303968afc082483534600f2f818f028715","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            is_dynamic\u003dis_dynamic"},{"line_number":77,"context_line":"        )"},{"line_number":78,"context_line":"        context.session.add(record)"},{"line_number":79,"context_line":"        registry.notify(resources.SEGMENT,"},{"line_number":80,"context_line":"                        events.PRECOMMIT_CREATE,"},{"line_number":81,"context_line":"                        trigger\u003dadd_network_segment,"},{"line_number":82,"context_line":"                        context\u003dcontext,"},{"line_number":83,"context_line":"                        segment\u003drecord)"},{"line_number":84,"context_line":"        segment[\u0027id\u0027] \u003d record.id"},{"line_number":85,"context_line":"    LOG.info(_LI(\"Added segment %(id)s of type %(network_type)s for network \""},{"line_number":86,"context_line":"                 \"%(network_id)s\"),"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_f4a909e1","line":83,"range":{"start_line":79,"start_character":0,"end_line":83,"end_character":39},"updated":"2016-07-02 07:42:58.000000000","message":"Can we \u0027session.flush(record)\u0027 before notify (or maybe move notify outside the sub-transaction) to check DB constraints before we send the notification?","commit_id":"040d740d20f268938bbbca06b41006331f0ee889"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"7d02900732a98db4b4e237249c9eb79085882c43","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            is_dynamic\u003dis_dynamic"},{"line_number":77,"context_line":"        )"},{"line_number":78,"context_line":"        context.session.add(record)"},{"line_number":79,"context_line":"        registry.notify(resources.SEGMENT,"},{"line_number":80,"context_line":"                        events.PRECOMMIT_CREATE,"},{"line_number":81,"context_line":"                        trigger\u003dadd_network_segment,"},{"line_number":82,"context_line":"                        context\u003dcontext,"},{"line_number":83,"context_line":"                        segment\u003drecord)"},{"line_number":84,"context_line":"        segment[\u0027id\u0027] \u003d record.id"},{"line_number":85,"context_line":"    LOG.info(_LI(\"Added segment %(id)s of type %(network_type)s for network \""},{"line_number":86,"context_line":"                 \"%(network_id)s\"),"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_567aea88","line":83,"range":{"start_line":79,"start_character":0,"end_line":83,"end_character":39},"in_reply_to":"1aa78d24_295d4679","updated":"2016-07-06 22:21:20.000000000","message":"\u003e Forcing a flush here will add a DB round trip\n\nAFAIK it would be the same number of DB round trips in the happy case (we can\u0027t insert into multiple different tables in one DB round trip, right?). But if we have a constraint violation, \u0027flush\u0027 will fail-fast and \u0027notify\u0027 would not be called. Though on the second thought the gain seems pretty insignificant, so probably not worth it.","commit_id":"040d740d20f268938bbbca06b41006331f0ee889"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"82b4aef0501c8e7709a64e4e2eaab934356741e0","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            is_dynamic\u003dis_dynamic"},{"line_number":77,"context_line":"        )"},{"line_number":78,"context_line":"        context.session.add(record)"},{"line_number":79,"context_line":"        registry.notify(resources.SEGMENT,"},{"line_number":80,"context_line":"                        events.PRECOMMIT_CREATE,"},{"line_number":81,"context_line":"                        trigger\u003dadd_network_segment,"},{"line_number":82,"context_line":"                        context\u003dcontext,"},{"line_number":83,"context_line":"                        segment\u003drecord)"},{"line_number":84,"context_line":"        segment[\u0027id\u0027] \u003d record.id"},{"line_number":85,"context_line":"    LOG.info(_LI(\"Added segment %(id)s of type %(network_type)s for network \""},{"line_number":86,"context_line":"                 \"%(network_id)s\"),"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_a5b80912","line":83,"range":{"start_line":79,"start_character":0,"end_line":83,"end_character":39},"in_reply_to":"1aa78d24_567aea88","updated":"2016-07-07 15:46:17.000000000","message":"Ok, fair enough.  I agree it isn\u0027t worth it.","commit_id":"040d740d20f268938bbbca06b41006331f0ee889"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4481cfc51b9192c041e644a703ac534f54a2cc5f","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            is_dynamic\u003dis_dynamic"},{"line_number":77,"context_line":"        )"},{"line_number":78,"context_line":"        context.session.add(record)"},{"line_number":79,"context_line":"        registry.notify(resources.SEGMENT,"},{"line_number":80,"context_line":"                        events.PRECOMMIT_CREATE,"},{"line_number":81,"context_line":"                        trigger\u003dadd_network_segment,"},{"line_number":82,"context_line":"                        context\u003dcontext,"},{"line_number":83,"context_line":"                        segment\u003drecord)"},{"line_number":84,"context_line":"        segment[\u0027id\u0027] \u003d record.id"},{"line_number":85,"context_line":"    LOG.info(_LI(\"Added segment %(id)s of type %(network_type)s for network \""},{"line_number":86,"context_line":"                 \"%(network_id)s\"),"}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_295d4679","line":83,"range":{"start_line":79,"start_character":0,"end_line":83,"end_character":39},"in_reply_to":"1aa78d24_f4a909e1","updated":"2016-07-06 20:53:21.000000000","message":"Do you think that\u0027s necessary?  The handler for this [1] runs in the same context and under the transaction (it is PRECOMMIT_CREATE).  If there are DB constraints, they will be checked at some point before the transaction is completed.  Forcing a flush here will add a DB round trip which, in the happy case, will not discover anything wrong.\n\n [1] https://github.com/openstack/neutron/blob/4a98b31b6ae5d59a64906224d3a8452d956667a6/neutron/services/segments/db.py#L213-L239","commit_id":"040d740d20f268938bbbca06b41006331f0ee889"}],"neutron/plugins/ml2/driver_context.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fa95738b3f5d6c5ac970a6f4dd68f3763434c631","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        network_id \u003d self._network_context.current[\u0027id\u0027]"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"        return self._plugin.type_manager.allocate_dynamic_segment("},{"line_number":262,"context_line":"                self._plugin_context, network_id, segment)"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def release_dynamic_segment(self, segment_id):"},{"line_number":265,"context_line":"        return self._plugin.type_manager.release_dynamic_segment("}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_55653d43","line":262,"updated":"2016-07-18 23:15:33.000000000","message":"are we sure we\u0027re not changing an API in a non bw compat fashion?","commit_id":"040d740d20f268938bbbca06b41006331f0ee889"}]}
