)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"036006bcac5b211e5f88c77f1f7c16d9f1609618","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently when doing set_target_cell() we lock both read and"},{"line_number":10,"context_line":"write operation, as the lock is added to prevent create duplicated"},{"line_number":11,"context_line":"db and mq connection, but actually this only happens in the ``write``"},{"line_number":12,"context_line":"process, we can only lock when race condition happens to increase"},{"line_number":13,"context_line":"the overall performance a little bit."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I03077af6ea2726099e24920f973b028895380991"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f79a3b5_02b899e2","line":12,"range":{"start_line":11,"start_character":22,"end_line":12,"end_character":8},"updated":"2018-08-23 10:21:02.000000000","message":"just to clarify, if I got it right, this means currently we lock at all times even to just check if that cell\u0027s mq and db are in the cache, so you propose to only lock if the global cells cache doesn\u0027t have the cell_mapping in which case if needs to create the connections and populate the cache ?","commit_id":"895f2f9902d746b0cfb6617451956a4f0a1abc86"}],"nova/context.py":[{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"ce2e6f5e7a6368f8b980984f910ffc07d606857d","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                context.mq_connection \u003d cell_tuple[1]"},{"line_number":379,"context_line":""},{"line_number":380,"context_line":"        try:"},{"line_number":381,"context_line":"            cell_tuple \u003d CELL_CACHE[cell_mapping.uuid]"},{"line_number":382,"context_line":"        except KeyError:"},{"line_number":383,"context_line":"            get_or_set_cached_cell_and_set_connections()"},{"line_number":384,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_02ce59b3","line":381,"updated":"2018-08-23 09:17:50.000000000","message":"Yes, if the cell record is exist, we can skip locked-update waiting.","commit_id":"31f5e0eb1b900ce04691259f9e726abe63c32b71"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"036006bcac5b211e5f88c77f1f7c16d9f1609618","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        @utils.synchronized(cell_mapping.uuid)"},{"line_number":364,"context_line":"        def get_or_set_cached_cell_and_set_connections():"},{"line_number":365,"context_line":"            # Try again get the info from cache to avoid create duplicated"},{"line_number":366,"context_line":"            # connections, as some concurrent worker may have already"},{"line_number":367,"context_line":"            # created it while we are waiting for the lock."},{"line_number":368,"context_line":"            try:"},{"line_number":369,"context_line":"                cell_tuple \u003d CELL_CACHE[cell_mapping.uuid]"},{"line_number":370,"context_line":"            except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_4810f300","line":367,"range":{"start_line":366,"start_character":27,"end_line":367,"end_character":59},"updated":"2018-08-23 10:21:02.000000000","message":"wondering if this was the initial reason for putting the cache check also inside the locking.","commit_id":"895f2f9902d746b0cfb6617451956a4f0a1abc86"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cae63bed63d39511b42689df1ee64fa45daac6b2","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        @utils.synchronized(cell_mapping.uuid)"},{"line_number":364,"context_line":"        def get_or_set_cached_cell_and_set_connections():"},{"line_number":365,"context_line":"            # Try again get the info from cache to avoid create duplicated"},{"line_number":366,"context_line":"            # connections, as some concurrent worker may have already"},{"line_number":367,"context_line":"            # created it while we are waiting for the lock."},{"line_number":368,"context_line":"            try:"},{"line_number":369,"context_line":"                cell_tuple \u003d CELL_CACHE[cell_mapping.uuid]"},{"line_number":370,"context_line":"            except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_fc55fd50","line":367,"range":{"start_line":366,"start_character":27,"end_line":367,"end_character":59},"in_reply_to":"3f79a3b5_3c31355a","updated":"2018-08-23 13:06:34.000000000","message":"It is, yes. I was just answering Surya\u0027s question/wondering.","commit_id":"895f2f9902d746b0cfb6617451956a4f0a1abc86"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"20de82f72034d95ad1662207477e0cf24cf0fcd6","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        @utils.synchronized(cell_mapping.uuid)"},{"line_number":364,"context_line":"        def get_or_set_cached_cell_and_set_connections():"},{"line_number":365,"context_line":"            # Try again get the info from cache to avoid create duplicated"},{"line_number":366,"context_line":"            # connections, as some concurrent worker may have already"},{"line_number":367,"context_line":"            # created it while we are waiting for the lock."},{"line_number":368,"context_line":"            try:"},{"line_number":369,"context_line":"                cell_tuple \u003d CELL_CACHE[cell_mapping.uuid]"},{"line_number":370,"context_line":"            except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_91363203","line":367,"range":{"start_line":366,"start_character":27,"end_line":367,"end_character":59},"in_reply_to":"3f79a3b5_4810f300","updated":"2018-08-23 12:42:26.000000000","message":"Yeah, you have to put the cache check inside the lock too because things could have changed since you checked outside the lock.","commit_id":"895f2f9902d746b0cfb6617451956a4f0a1abc86"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ec14c5104601f251a6bd99e48f28a2f09f7a8f17","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        @utils.synchronized(cell_mapping.uuid)"},{"line_number":364,"context_line":"        def get_or_set_cached_cell_and_set_connections():"},{"line_number":365,"context_line":"            # Try again get the info from cache to avoid create duplicated"},{"line_number":366,"context_line":"            # connections, as some concurrent worker may have already"},{"line_number":367,"context_line":"            # created it while we are waiting for the lock."},{"line_number":368,"context_line":"            try:"},{"line_number":369,"context_line":"                cell_tuple \u003d CELL_CACHE[cell_mapping.uuid]"},{"line_number":370,"context_line":"            except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_3c31355a","line":367,"range":{"start_line":366,"start_character":27,"end_line":367,"end_character":59},"in_reply_to":"3f79a3b5_91363203","updated":"2018-08-23 13:02:57.000000000","message":"Isn\u0027t it already in there? L369\n\nHe\u0027s just copying the check to outside the lock, but it\u0027s still in there.","commit_id":"895f2f9902d746b0cfb6617451956a4f0a1abc86"},{"author":{"_account_id":26936,"name":"Surya Seetharaman","email":"suryaseetharaman.9@gmail.com","username":"tssurya"},"change_message_id":"036006bcac5b211e5f88c77f1f7c16d9f1609618","unresolved":false,"context_lines":[{"line_number":380,"context_line":"                context.db_connection \u003d cell_tuple[0]"},{"line_number":381,"context_line":"                context.mq_connection \u003d cell_tuple[1]"},{"line_number":382,"context_line":""},{"line_number":383,"context_line":"        # Try to get the info from cache first, if it is not there,"},{"line_number":384,"context_line":"        # create it and save it to cache"},{"line_number":385,"context_line":"        try:"},{"line_number":386,"context_line":"            cell_tuple \u003d CELL_CACHE[cell_mapping.uuid]"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_a869878c","line":383,"updated":"2018-08-23 10:21:02.000000000","message":"looks good, but I am not an expert with races; we can wait for the experts then,\nlittle code duplication, but worth it for performance..","commit_id":"895f2f9902d746b0cfb6617451956a4f0a1abc86"}]}
