)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a303c7cfcb2e1b1191f20838693bc01569504b2e","unresolved":true,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"This change simply removes the cleanup from nova_volume_attach and"},{"line_number":19,"context_line":"relies on the existing logic within the tests to detach the volume when"},{"line_number":20,"context_line":"required."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Closes-Bug: #1908399"},{"line_number":23,"context_line":"Change-Id: Ib6ae2c30be65eb444976b0330fd23d9457146284"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9cddf6e3_816ecc61","line":20,"updated":"2020-12-17 11:54:39.000000000","message":"Yeah, the other way would be more intrusive to change all the tests calling this helper not to do specific detach in the test or during cleanup.","commit_id":"890ee6ecf00b74bbeb2544b151e4c82db8950fde"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"1e93540e6279499f90cc1f2579cf730a25ad42bc","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"This change simply removes the cleanup from nova_volume_attach and"},{"line_number":19,"context_line":"relies on the existing logic within the tests to detach the volume when"},{"line_number":20,"context_line":"required."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"Closes-Bug: #1908399"},{"line_number":23,"context_line":"Change-Id: Ib6ae2c30be65eb444976b0330fd23d9457146284"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"646f67a0_c68ba01a","line":20,"in_reply_to":"9cddf6e3_816ecc61","updated":"2020-12-21 14:31:18.000000000","message":"Ack","commit_id":"890ee6ecf00b74bbeb2544b151e4c82db8950fde"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"37dad26fc6fe7c0bad3cc7ec99decb3f648f464e","unresolved":true,"context_lines":[{"line_number":20,"context_line":"nova_volume_detach was being called multiple times during tests and"},{"line_number":21,"context_line":"cleanup while only waiting for the volume status to change to available."},{"line_number":22,"context_line":"This allowed for a race to occur where additional requests could be made"},{"line_number":23,"context_line":"to detach the volume while the volume attachment still remained in Nova"},{"line_number":24,"context_line":"resulting in a 400 error being returned by n-api."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"This change addresses this by switching between the volume resource"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9b644074_a4307a56","line":23,"range":{"start_line":23,"start_character":21,"end_line":23,"end_character":71},"updated":"2020-12-21 19:41:00.000000000","message":"after the volume was already marked as available in cinder. This results in c-api rejecting a request by n-api to start the detaching process leading to n-api failing the request and returning 400 to the caller.","commit_id":"5423c530955bdc5d1dbea0c4bf860b19655d5e2c"}],"tempest/scenario/manager.py":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"1e93540e6279499f90cc1f2579cf730a25ad42bc","unresolved":true,"context_lines":[{"line_number":732,"context_line":"            **kwargs)[\u0027volumeAttachment\u0027]"},{"line_number":733,"context_line":"        self.assertEqual(volume_to_attach[\u0027id\u0027], volume[\u0027id\u0027])"},{"line_number":734,"context_line":"        waiters.wait_for_volume_resource_status(self.volumes_client,"},{"line_number":735,"context_line":"                                                volume[\u0027id\u0027], \u0027in-use\u0027)"},{"line_number":736,"context_line":"        self.addCleanup(test_utils.call_and_ignore_notfound_exc,"},{"line_number":737,"context_line":"                        self.nova_volume_detach, server, volume)"},{"line_number":738,"context_line":"        # Return the updated volume after the attachment"},{"line_number":739,"context_line":"        return self.volumes_client.show_volume(volume[\u0027id\u0027])[\u0027volume\u0027]"},{"line_number":740,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ae06a58c_d717524b","side":"PARENT","line":737,"range":{"start_line":735,"start_character":0,"end_line":737,"end_character":64},"updated":"2020-12-21 14:31:18.000000000","message":"But I expect if test is doing the detach as part of test or cleanup then they should wait for detach async operation to complete otherwise there can be more race issue happen.\n\nHow about adding the wait-for-detach cleanup here too and also for tests which are causing this issue.","commit_id":"0e0264636f318920e709b97c4ea6f4df1e2d27fb"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"ba54101bd92292d8e7ca84601bab6ee857d1925b","unresolved":true,"context_lines":[{"line_number":732,"context_line":"            **kwargs)[\u0027volumeAttachment\u0027]"},{"line_number":733,"context_line":"        self.assertEqual(volume_to_attach[\u0027id\u0027], volume[\u0027id\u0027])"},{"line_number":734,"context_line":"        waiters.wait_for_volume_resource_status(self.volumes_client,"},{"line_number":735,"context_line":"                                                volume[\u0027id\u0027], \u0027in-use\u0027)"},{"line_number":736,"context_line":"        self.addCleanup(test_utils.call_and_ignore_notfound_exc,"},{"line_number":737,"context_line":"                        self.nova_volume_detach, server, volume)"},{"line_number":738,"context_line":"        # Return the updated volume after the attachment"},{"line_number":739,"context_line":"        return self.volumes_client.show_volume(volume[\u0027id\u0027])[\u0027volume\u0027]"},{"line_number":740,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"95a4c5af_c36b65d9","side":"PARENT","line":737,"range":{"start_line":735,"start_character":0,"end_line":737,"end_character":64},"in_reply_to":"ae06a58c_d717524b","updated":"2020-12-21 14:53:13.000000000","message":"I searched through the scenario tests and all the test using these common method to attach and detach the volume.\n\nnova_volume_detach() method already wait for the detach to complete L747 so there should not be any race with this cleanup.\n\nand this cleanup also detaching volume via nova_volume_detach() which intern wait for volume to detach. Seems all good for me, not sure what causing the race here.","commit_id":"0e0264636f318920e709b97c4ea6f4df1e2d27fb"}]}
