)]}'
{"placement/tests/functional/test_allocation.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"66060f39062fb2598f08250d0f9ef830977334c1","unresolved":true,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"POST_ALLOCATIONS_DATA \u003d jsonutils.dump_as_bytes({"},{"line_number":56,"context_line":"    uuids.consumer: {"},{"line_number":57,"context_line":"        \u0027project_id\u0027: uuids.project,"},{"line_number":58,"context_line":"        \u0027user_id\u0027: uuids.user,"},{"line_number":59,"context_line":"        \u0027consumer_generation\u0027: None,"}],"source_content_type":"text/x-python","patch_set":1,"id":"efaf18c9_d6a0d76c","line":56,"range":{"start_line":56,"start_character":4,"end_line":56,"end_character":18},"updated":"2021-09-06 14:40:35.000000000","message":"this is a module global, so each test case will use the same consumer uuid and as test can be run parallel this can cause that they interfere","commit_id":"f4c9c82f753380b221520d4184835b62cebc4205"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"aff40eff407662395b4ac607e841766058d187f1","unresolved":true,"context_lines":[{"line_number":342,"context_line":""},{"line_number":343,"context_line":"                proc \u003d multiprocessing.Process(target\u003drun)"},{"line_number":344,"context_line":"                proc.start()"},{"line_number":345,"context_line":"                proc.join()"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"            return real_set_allocations(ctx, alloc_list)"},{"line_number":348,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"cc8c419b_6786971c","line":345,"updated":"2021-09-06 06:00:09.000000000","message":"I know this is horrid but after much struggling I was still at a loss how else to reproduce the issue without masking the real bug with database lock timeout errors. If anyone knows a better way to do this, feel free to change this or let me know and I can change it.","commit_id":"f4c9c82f753380b221520d4184835b62cebc4205"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0e4a63a16605fab3e8ab5936b03dc039b273f0ba","unresolved":true,"context_lines":[{"line_number":342,"context_line":""},{"line_number":343,"context_line":"                proc \u003d multiprocessing.Process(target\u003drun)"},{"line_number":344,"context_line":"                proc.start()"},{"line_number":345,"context_line":"                proc.join()"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"            return real_set_allocations(ctx, alloc_list)"},{"line_number":348,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da76ccb3_d0a27f5b","line":345,"in_reply_to":"cc8c419b_6786971c","updated":"2021-09-06 15:17:10.000000000","message":"One way to avoid multiprocessing is to simulate the race a bit differently.\n\nAs far as I see all three codepath calls placement.handlers.allocation._resource_providers_by_uuid() to collect the current RP information including generation _before_ goes into replace_all(). \n\nWhat if we simulate the race not by bumping the RP generation after the RP was read by the normal codepath, but instead wrap placement.handlers.allocation._resource_providers_by_uuid() to return the RPs with RP.generation - 1. So when the normal codepath in _set_allocation compares the request data with the DB date, it will see a \"newer\" generation and fail with conflict, then we can let the normal codepath to re-try and succeed.","commit_id":"f4c9c82f753380b221520d4184835b62cebc4205"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e0e9bd1850f475d00d52cce1925bdee2b0e823ab","unresolved":true,"context_lines":[{"line_number":342,"context_line":""},{"line_number":343,"context_line":"                proc \u003d multiprocessing.Process(target\u003drun)"},{"line_number":344,"context_line":"                proc.start()"},{"line_number":345,"context_line":"                proc.join()"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"            return real_set_allocations(ctx, alloc_list)"},{"line_number":348,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"4fddcabe_ab60f575","line":345,"in_reply_to":"da76ccb3_d0a27f5b","updated":"2021-09-06 15:48:02.000000000","message":"Nope ^^ does not work. As with this logic the first RP read (the one we are wrapping) and the subsequent re-reads in the retry returns different RP.generation values regardless of the transaction isolation. So this way the problem cannot be reproduced.","commit_id":"f4c9c82f753380b221520d4184835b62cebc4205"}]}
