)]}'
{"nova/api/openstack/placement/objects/resource_provider.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9a98613df2c467baa4b5f96edb21d1656ea15adc","unresolved":false,"context_lines":[{"line_number":545,"context_line":"                          resource_provider.uuid, agg_uuid, new_aggregate.id)"},{"line_number":546,"context_line":"                continue"},{"line_number":547,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":548,"context_line":"                # Something else added this agg_uuid in between out initial"},{"line_number":549,"context_line":"                # fetch above and when we tried flushing this session, so let\u0027s"},{"line_number":550,"context_line":"                # grab whatever that other thing added."},{"line_number":551,"context_line":"                LOG.debug(\"Setting aggregates for provider %s. Failed to \""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_ee22c3ba","line":548,"range":{"start_line":548,"start_character":64,"end_line":548,"end_character":67},"updated":"2018-08-16 19:15:29.000000000","message":"our...","commit_id":"399c48ce92b8acf17d410c84f20b2fda44480ac4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"42db301785b1a48e732864e88918055efb5b2117","unresolved":false,"context_lines":[{"line_number":553,"context_line":"                          \"created an aggregate record. Looking up that \""},{"line_number":554,"context_line":"                          \"aggregate record.\","},{"line_number":555,"context_line":"                          resource_provider.uuid, agg_uuid)"},{"line_number":556,"context_line":"                found_agg \u003d context.session.query("},{"line_number":557,"context_line":"                    models.PlacementAggregate).filter_by("},{"line_number":558,"context_line":"                        uuid\u003dagg_uuid).first()"},{"line_number":559,"context_line":"        aggs_to_associate[found_agg.id] \u003d found_agg.uuid"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"    for agg_id, agg_uuid in aggs_to_associate.items():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_de453245","line":558,"range":{"start_line":556,"start_character":16,"end_line":558,"end_character":46},"updated":"2018-08-16 20:56:02.000000000","message":"I know it\u0027s farfetched, but if something else also *deleted* that aggregate between DBDuplicateEntry and here, found_agg will end up empty (again) and the line below will fail. Do we care to trap that (and at least make the failure prettier)?","commit_id":"399c48ce92b8acf17d410c84f20b2fda44480ac4"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"5719af3f3952584a30b14678f06ad5cc323ddfae","unresolved":false,"context_lines":[{"line_number":553,"context_line":"                          \"created an aggregate record. Looking up that \""},{"line_number":554,"context_line":"                          \"aggregate record.\","},{"line_number":555,"context_line":"                          resource_provider.uuid, agg_uuid)"},{"line_number":556,"context_line":"                found_agg \u003d context.session.query("},{"line_number":557,"context_line":"                    models.PlacementAggregate).filter_by("},{"line_number":558,"context_line":"                        uuid\u003dagg_uuid).first()"},{"line_number":559,"context_line":"        aggs_to_associate[found_agg.id] \u003d found_agg.uuid"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"    for agg_id, agg_uuid in aggs_to_associate.items():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_d14a03ab","line":558,"range":{"start_line":556,"start_character":16,"end_line":558,"end_character":46},"in_reply_to":"3f79a3b5_de453245","updated":"2018-08-16 21:53:09.000000000","message":"I\u0027m reworking this to this shouldn\u0027t be an issue.","commit_id":"399c48ce92b8acf17d410c84f20b2fda44480ac4"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9a98613df2c467baa4b5f96edb21d1656ea15adc","unresolved":false,"context_lines":[{"line_number":567,"context_line":"                      \"associated aggregate %s.\","},{"line_number":568,"context_line":"                      resource_provider.uuid, agg_uuid)"},{"line_number":569,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":570,"context_line":"            # Another thread already set this aggregate for this provider."},{"line_number":571,"context_line":"            LOG.debug(\"Setting aggregates for provider %s. Another thread \""},{"line_number":572,"context_line":"                      \"already associated aggregate %s. Skipping.\","},{"line_number":573,"context_line":"                      resource_provider.uuid, agg_uuid)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_8e1d4f75","line":570,"updated":"2018-08-16 19:15:29.000000000","message":"I can remove this comment since the log message tells the same story.","commit_id":"399c48ce92b8acf17d410c84f20b2fda44480ac4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"42db301785b1a48e732864e88918055efb5b2117","unresolved":false,"context_lines":[{"line_number":577,"context_line":"        del_stmt \u003d _RP_AGG_TBL.delete().where(sa.and_("},{"line_number":578,"context_line":"                _RP_AGG_TBL.c.resource_provider_id \u003d\u003d rp_id,"},{"line_number":579,"context_line":"                _RP_AGG_TBL.c.aggregate_id \u003d\u003d agg_id))"},{"line_number":580,"context_line":"        context.session.execute(del_stmt)"},{"line_number":581,"context_line":"        LOG.debug(\"Setting aggregates for provider %s. Successfully \""},{"line_number":582,"context_line":"                  \"disassociated aggregate %s.\","},{"line_number":583,"context_line":"                  resource_provider.uuid, agg_uuid)"},{"line_number":584,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_9e87ba62","line":581,"range":{"start_line":580,"start_character":0,"end_line":581,"end_character":1},"updated":"2018-08-16 20:56:02.000000000","message":"does this silently no-op if the entry was already removed by another thread?","commit_id":"399c48ce92b8acf17d410c84f20b2fda44480ac4"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"5719af3f3952584a30b14678f06ad5cc323ddfae","unresolved":false,"context_lines":[{"line_number":577,"context_line":"        del_stmt \u003d _RP_AGG_TBL.delete().where(sa.and_("},{"line_number":578,"context_line":"                _RP_AGG_TBL.c.resource_provider_id \u003d\u003d rp_id,"},{"line_number":579,"context_line":"                _RP_AGG_TBL.c.aggregate_id \u003d\u003d agg_id))"},{"line_number":580,"context_line":"        context.session.execute(del_stmt)"},{"line_number":581,"context_line":"        LOG.debug(\"Setting aggregates for provider %s. Successfully \""},{"line_number":582,"context_line":"                  \"disassociated aggregate %s.\","},{"line_number":583,"context_line":"                  resource_provider.uuid, agg_uuid)"},{"line_number":584,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_11515b63","line":581,"range":{"start_line":580,"start_character":0,"end_line":581,"end_character":1},"in_reply_to":"3f79a3b5_9e87ba62","updated":"2018-08-16 21:53:09.000000000","message":"Yep. I don\u0027t really see a problem with that. I suppose I could put a conditional:\n\n res \u003d context.session.execute(del_stmt)\n if res.rowcount \u003e 0:\n     LOG.debug(...)","commit_id":"399c48ce92b8acf17d410c84f20b2fda44480ac4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"788a4cb0ace9eb808e85c30abe246680c46315cd","unresolved":false,"context_lines":[{"line_number":488,"context_line":"    return set([(r[0], r[1]) for r in context.session.execute(sel).fetchall()])"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":""},{"line_number":491,"context_line":"@db_api.placement_context_manager.independent.writer"},{"line_number":492,"context_line":"def _ensure_aggregate(ctx, agg_uuid):"},{"line_number":493,"context_line":"    \"\"\"Finds an aggregate and returns its internal ID. If not found, creates"},{"line_number":494,"context_line":"    the aggregate and returns the new aggregate\u0027s internal ID."}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_b46175d6","line":491,"range":{"start_line":491,"start_character":34,"end_line":491,"end_character":45},"updated":"2018-08-16 22:12:48.000000000","message":"This will now create the aggregate even if the overall transaction fails, which is slightly more leaky than before. Probably worth a NOTE/TODO.","commit_id":"2d7ed309ec4e656ce9d6f21f03ea158278f2526d"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f916e7fae3abd7e55cde7ff71defb6bc3a9565d3","unresolved":false,"context_lines":[{"line_number":488,"context_line":"    return set([(r[0], r[1]) for r in context.session.execute(sel).fetchall()])"},{"line_number":489,"context_line":""},{"line_number":490,"context_line":""},{"line_number":491,"context_line":"@db_api.placement_context_manager.independent.writer"},{"line_number":492,"context_line":"def _ensure_aggregate(ctx, agg_uuid):"},{"line_number":493,"context_line":"    \"\"\"Finds an aggregate and returns its internal ID. If not found, creates"},{"line_number":494,"context_line":"    the aggregate and returns the new aggregate\u0027s internal ID."}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_05f8357a","line":491,"range":{"start_line":491,"start_character":34,"end_line":491,"end_character":45},"in_reply_to":"3f79a3b5_b46175d6","updated":"2018-08-17 02:11:44.000000000","message":"true enough, yes.","commit_id":"2d7ed309ec4e656ce9d6f21f03ea158278f2526d"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f916e7fae3abd7e55cde7ff71defb6bc3a9565d3","unresolved":false,"context_lines":[{"line_number":508,"context_line":"                  agg_uuid, agg_id)"},{"line_number":509,"context_line":"        return agg_id"},{"line_number":510,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":511,"context_line":"        # Something else added this agg_uuid in between our initial"},{"line_number":512,"context_line":"        # fetch above and when we tried flushing this session, so let\u0027s"},{"line_number":513,"context_line":"        # grab whatever that other thing added."},{"line_number":514,"context_line":"        LOG.debug(\"_ensure_provider() failed to create new aggregate %s. \""},{"line_number":515,"context_line":"                  \"Another thread already created an aggregate record. \""},{"line_number":516,"context_line":"                  \"Looking up that aggregate record.\","}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_45338d63","line":513,"range":{"start_line":511,"start_character":0,"end_line":513,"end_character":47},"updated":"2018-08-17 02:11:44.000000000","message":"I can probably delete this comment now (the debug message says basically the same thing...)","commit_id":"2d7ed309ec4e656ce9d6f21f03ea158278f2526d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"bb033d62afa649df985bee42c617451f775d544a","unresolved":false,"context_lines":[{"line_number":508,"context_line":"                  agg_uuid, agg_id)"},{"line_number":509,"context_line":"        return agg_id"},{"line_number":510,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":511,"context_line":"        # Something else added this agg_uuid in between our initial"},{"line_number":512,"context_line":"        # fetch above and when we tried flushing this session, so let\u0027s"},{"line_number":513,"context_line":"        # grab whatever that other thing added."},{"line_number":514,"context_line":"        LOG.debug(\"_ensure_provider() failed to create new aggregate %s. \""},{"line_number":515,"context_line":"                  \"Another thread already created an aggregate record. \""},{"line_number":516,"context_line":"                  \"Looking up that aggregate record.\","}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_066271d9","line":513,"range":{"start_line":511,"start_character":0,"end_line":513,"end_character":47},"in_reply_to":"3f79a3b5_45338d63","updated":"2018-08-17 11:23:58.000000000","message":"yeah, may as well","commit_id":"2d7ed309ec4e656ce9d6f21f03ea158278f2526d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"bb033d62afa649df985bee42c617451f775d544a","unresolved":false,"context_lines":[{"line_number":515,"context_line":"                  \"Another thread already created an aggregate record. \""},{"line_number":516,"context_line":"                  \"Looking up that aggregate record.\","},{"line_number":517,"context_line":"                  agg_uuid)"},{"line_number":518,"context_line":"        return _ensure_aggregate(ctx, agg_uuid)"},{"line_number":519,"context_line":""},{"line_number":520,"context_line":""},{"line_number":521,"context_line":"@db_api.placement_context_manager.writer"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_a6a85ddb","line":518,"updated":"2018-08-17 11:23:58.000000000","message":"I\u0027m going to craft an attack against the placement service that will lock this in infinite loop. Then, once I\u0027ve broken all openstack clouds, I will do something useful with my time.","commit_id":"2d7ed309ec4e656ce9d6f21f03ea158278f2526d"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"91fd64db1efb0d6a4a4317da7c7bee0cde053f64","unresolved":false,"context_lines":[{"line_number":515,"context_line":"                  \"Another thread already created an aggregate record. \""},{"line_number":516,"context_line":"                  \"Looking up that aggregate record.\","},{"line_number":517,"context_line":"                  agg_uuid)"},{"line_number":518,"context_line":"        return _ensure_aggregate(ctx, agg_uuid)"},{"line_number":519,"context_line":""},{"line_number":520,"context_line":""},{"line_number":521,"context_line":"@db_api.placement_context_manager.writer"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_b735e5aa","line":518,"in_reply_to":"3f79a3b5_a6a85ddb","updated":"2018-08-17 14:06:25.000000000","message":"Wouldn\u0027t you need the ability to delete an aggregate first?  :P","commit_id":"2d7ed309ec4e656ce9d6f21f03ea158278f2526d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"bb033d62afa649df985bee42c617451f775d544a","unresolved":false,"context_lines":[{"line_number":537,"context_line":"    # A dict, keyed by internal aggregate ID, of aggregate UUIDs that will be"},{"line_number":538,"context_line":"    # associated with the provider"},{"line_number":539,"context_line":"    aggs_to_associate \u003d {}"},{"line_number":540,"context_line":"    # Same dict for those aggregates to remove the association with this"},{"line_number":541,"context_line":"    # provider"},{"line_number":542,"context_line":"    aggs_to_disassociate \u003d {"},{"line_number":543,"context_line":"        agg_id: agg_uuid for agg_id, agg_uuid in existing_aggregates.items()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_e6ec152b","line":540,"range":{"start_line":540,"start_character":6,"end_line":540,"end_character":15},"updated":"2018-08-17 11:23:58.000000000","message":"\"Same\" is confusing to me here. You mean the same structure?","commit_id":"2d7ed309ec4e656ce9d6f21f03ea158278f2526d"}]}
