)]}'
{"nova/objects/resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d72a2cb487edaede7ea86305de3766e5f5b3012e","unresolved":false,"context_lines":[{"line_number":1672,"context_line":"        try:"},{"line_number":1673,"context_line":"            res \u003d conn.execute(tbl.insert().values(external_id\u003dexternal_id))"},{"line_number":1674,"context_line":"            return res.inserted_primary_key[0]"},{"line_number":1675,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":1676,"context_line":"            # Another thread added it just before us, so just read the"},{"line_number":1677,"context_line":"            # internal ID that that thread created..."},{"line_number":1678,"context_line":"            return _ensure_lookup_table_entry(conn, tbl, external_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff82abbf_f57bdb24","line":1675,"range":{"start_line":1675,"start_character":22,"end_line":1675,"end_character":38},"updated":"2017-11-27 14:48:46.000000000","message":"jaypipes thinks the fix might be that we need to catch DB Deadlock here as well.","commit_id":"92b657f7ab70935fdd5c0c32914506cb1cc37993"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"66945a8f3aafa22954447a07147ea65103c1042d","unresolved":false,"context_lines":[{"line_number":1675,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":1676,"context_line":"            # Another thread added it just before us, so just read the"},{"line_number":1677,"context_line":"            # internal ID that that thread created..."},{"line_number":1678,"context_line":"            return _ensure_lookup_table_entry(conn, tbl, external_id)"},{"line_number":1679,"context_line":""},{"line_number":1680,"context_line":"    return res[0][0]"},{"line_number":1681,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_7673fae8","line":1678,"updated":"2017-11-11 18:13:09.000000000","message":"I don\u0027t see how this would fix things if the insert failed with a duplicate entry, we should get it back from the select query.","commit_id":"92b657f7ab70935fdd5c0c32914506cb1cc37993"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d88872b3b1cc10828d9863c4c905d1794d5914df","unresolved":false,"context_lines":[{"line_number":1675,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":1676,"context_line":"            # Another thread added it just before us, so just read the"},{"line_number":1677,"context_line":"            # internal ID that that thread created..."},{"line_number":1678,"context_line":"            return _ensure_lookup_table_entry(conn, tbl, external_id)"},{"line_number":1679,"context_line":""},{"line_number":1680,"context_line":"    return res[0][0]"},{"line_number":1681,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_562ebea5","line":1678,"in_reply_to":"1f485f77_7673fae8","updated":"2017-11-11 18:35:20.000000000","message":"Right, the race is:\n\n- We SELECT on L1670, don\u0027t find it.\n- The other guy INSERTs the record.\n- We attempt INSERT on L1673, get the exception.\n- The other guy deletes the entry.\n- We do the second SELECT here; it returns no results.\n\nI\u0027ll grant you a real solution ought to limit the number of retries.  This is a quick-and-dirty to see if it makes the problem unreproducible.","commit_id":"92b657f7ab70935fdd5c0c32914506cb1cc37993"}]}
