)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"effc6f50cf335d5a238fe8ba355c0b830bb11bdf","unresolved":false,"context_lines":[{"line_number":48,"context_line":"is \u0027volume\u0027, but the _shutdown_instance code needs the bdm.volume_id"},{"line_number":49,"context_line":"to be set."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Closes-Bug: #1464259"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Change-Id: Ib60d60a5af35be89ad8afbcf44fcffe0b0ce2876"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a740942_c564eee6","line":51,"range":{"start_line":51,"start_character":0,"end_line":51,"end_character":20},"updated":"2015-12-09 16:28:22.000000000","message":"I guess this is correct seeing how the bug was formulated \n\n\"Volumes tests fails often with rbd backend\"\n\nThey are likely to fail \"less often\"\n\nThis really does not fix the underlying bug. This is our current approach: we hack the code to make a test pass that has already successfully found the bug, that we decided (implicitly I guess) is too much hassle to actually fix. This is completely backwards imho.","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6a8c0810612740a670a7b81a019be39993f2c12c","unresolved":false,"context_lines":[{"line_number":48,"context_line":"is \u0027volume\u0027, but the _shutdown_instance code needs the bdm.volume_id"},{"line_number":49,"context_line":"to be set."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Closes-Bug: #1464259"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Change-Id: Ib60d60a5af35be89ad8afbcf44fcffe0b0ce2876"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a740942_2d627017","line":51,"in_reply_to":"7a740942_3c94e8e6","updated":"2015-12-09 20:28:50.000000000","message":"Ignore the previous comment, we should just have a single process for the compute service, so the locks are OK.\n\nThe problem where the locks break down is when we get an UnexpectedDeletingTaskStateError in the compute during the build:\n\nhttp://logs.openstack.org/20/218120/3/check/gate-tempest-dsvm-full-ceph/2349f2d/logs/screen-n-cpu.txt.gz#_2015-12-07_05_51_15_280\n\nThen the lock is freed up and the delete can happen in the compute.\n\nIn the logs for this failure, I think the UnexpectedDeletingTaskStateError happens here:\n\nhttps://github.com/openstack/nova/blob/master/nova/compute/manager.py#L2102\n\nWhich with my change, we\u0027d have the bdm.volume_id set by then.  But that will release the lock during the build so delete can get to _shutdown_instance.\n\n--\n\nAnyway, I think we should go with this, log the warning in _shutdown_instance if bdm.volume_id isn\u0027t set, and track from there.  If things are still racy, we have to come back on this.  I could see possible alternatives being creating the volume up front in the API or conductor before the compute (the compute doesn\u0027t really need to create the volume, just attach it).  Then we\u0027d at least have the volume_id earlier so we can roll that back if needed.","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"90e7c5b955faceceb5c93b0879fe8edfa489bd59","unresolved":false,"context_lines":[{"line_number":48,"context_line":"is \u0027volume\u0027, but the _shutdown_instance code needs the bdm.volume_id"},{"line_number":49,"context_line":"to be set."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Closes-Bug: #1464259"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Change-Id: Ib60d60a5af35be89ad8afbcf44fcffe0b0ce2876"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a740942_3c94e8e6","line":51,"in_reply_to":"7a740942_9cbabc09","updated":"2015-12-09 19:25:04.000000000","message":"Since we don\u0027t specify external\u003dTrue on those locks, they don\u0027t work across requests since they are per-process and not global locks on the host.","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"8e5312aa8fcd5c8cdbf0a8c332e82c791cd6413c","unresolved":false,"context_lines":[{"line_number":48,"context_line":"is \u0027volume\u0027, but the _shutdown_instance code needs the bdm.volume_id"},{"line_number":49,"context_line":"to be set."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Closes-Bug: #1464259"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Change-Id: Ib60d60a5af35be89ad8afbcf44fcffe0b0ce2876"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a740942_e539eaf3","line":51,"in_reply_to":"7a740942_a5d0c2f8","updated":"2015-12-09 16:46:04.000000000","message":"Yes - the test is fine. it caught a bug. the bug is that we do not synchronise deleting an instance with any ongoing tasks happening in Cinder (or elsewhere).\n\nWe are however not fixing this bug here - we\u0027re hacking the code so that the tests is less likely to fail and not even being explicit about it.\n\nThe fix is to have a way to either wait or cancel ongoing long running tasks when instance is being deleted.\n\nWe actually had a similar bug to this in libvirt recently (see bug #1387543). We should be doing something similar for this case.","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"af2ab75fe7e566607c25f9fd0d6d02b498d5a06c","unresolved":false,"context_lines":[{"line_number":48,"context_line":"is \u0027volume\u0027, but the _shutdown_instance code needs the bdm.volume_id"},{"line_number":49,"context_line":"to be set."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Closes-Bug: #1464259"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Change-Id: Ib60d60a5af35be89ad8afbcf44fcffe0b0ce2876"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a740942_f9e672af","line":51,"in_reply_to":"7a740942_ab697327","updated":"2015-12-09 18:59:50.000000000","message":"So you\u0027re thinking about adding a synchronized lock to _prep_block_devices and _shutdown_instance?","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e2bc8e19e71be33cc0ffb76548893962ee1e9def","unresolved":false,"context_lines":[{"line_number":48,"context_line":"is \u0027volume\u0027, but the _shutdown_instance code needs the bdm.volume_id"},{"line_number":49,"context_line":"to be set."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Closes-Bug: #1464259"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Change-Id: Ib60d60a5af35be89ad8afbcf44fcffe0b0ce2876"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a740942_a5d0c2f8","line":51,"in_reply_to":"7a740942_c564eee6","updated":"2015-12-09 16:37:13.000000000","message":"I\u0027m not really following. If you know of a better fix for this, please elaborate.\n\nThe test is not flawed, it\u0027s actually a pretty good test given the race failure it\u0027s teasing out of the code. We could make the test not fail by waiting for the 2nd server to be active before deleting it (at which point the bdm.volume_id would be set in the DB), but that\u0027s not a reliable real world case - people delete servers before they are active all the time simply because they might have screwed up on the parameters they picked for the boot (wrong image, wrong flavor, etc).","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"1e847db559a1be27f84c0eb96a759609867b52ef","unresolved":false,"context_lines":[{"line_number":48,"context_line":"is \u0027volume\u0027, but the _shutdown_instance code needs the bdm.volume_id"},{"line_number":49,"context_line":"to be set."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Closes-Bug: #1464259"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Change-Id: Ib60d60a5af35be89ad8afbcf44fcffe0b0ce2876"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a740942_ab697327","line":51,"in_reply_to":"7a740942_e539eaf3","updated":"2015-12-09 17:20:48.000000000","message":"Actually thinking about this some more - we should at least take a stab at fixing this issue properly, so that we have an excuse for the hatchet job we are proposing here.\n\nIt\u0027s all linked to a single instance so locking on the host on the uuid should get us a long way.","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"107a4383750aab9054e7955f0de400d2bfcb9958","unresolved":false,"context_lines":[{"line_number":48,"context_line":"is \u0027volume\u0027, but the _shutdown_instance code needs the bdm.volume_id"},{"line_number":49,"context_line":"to be set."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Closes-Bug: #1464259"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"Change-Id: Ib60d60a5af35be89ad8afbcf44fcffe0b0ce2876"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a740942_9cbabc09","line":51,"in_reply_to":"7a740942_f9e672af","updated":"2015-12-09 19:09:57.000000000","message":"There are actually locks on the instance uuid while prepping block devices and deleting the instance:\n\n1. build: https://github.com/openstack/nova/blob/c4ca1abb4a49bf0bce765acd3ce906bd117ce9b7/nova/compute/manager.py#L1847\n\n2. delete: https://github.com/openstack/nova/blob/c4ca1abb4a49bf0bce765acd3ce906bd117ce9b7/nova/compute/manager.py#L2439\n\nMaybe delete (at least when processing volume BDMs to remove) needs to grab the _build_semaphore?","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"fd2adb15d82688c59991644576b0412328f65c4c","unresolved":false,"context_lines":[{"line_number":21,"context_line":"   background)"},{"line_number":22,"context_line":"7. cleanup"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"There is a race when booting server2 such that the"},{"line_number":25,"context_line":"block_device_mapping.volume_id field may not be set by the time we\u0027ve"},{"line_number":26,"context_line":"created volume2 and attached it to server2 and the delete request is"},{"line_number":27,"context_line":"made for server2."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"So the delete request starts tearing down and looking for volume BDMs so"},{"line_number":30,"context_line":"the compute manager can terminate the connection, detach the volume and,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7a740942_040fede1","line":27,"range":{"start_line":24,"start_character":1,"end_line":27,"end_character":17},"updated":"2015-12-11 10:18:28.000000000","message":"I don\u0027t think this is true - nothing in our investigation points that this is what is happening.\n\nThere is mutual exclusion between terminate_instance and build_and_run_instance (@utils.synchronized(instance.uuid)) so terminate will not proceed on the compute host before all volumes have been saved even if there was an exception.","commit_id":"21fc72667d962935913113a4ac37c0019fea2196"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"764a97271659f1e8be98eedc8961003fa47b6b6f","unresolved":false,"context_lines":[{"line_number":24,"context_line":"There is a race when booting server2 such that the"},{"line_number":25,"context_line":"block_device_mapping.volume_id field may not be set by the time we\u0027ve"},{"line_number":26,"context_line":"created volume2 and attached it to server2 and the delete request is"},{"line_number":27,"context_line":"made for server2."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"So the delete request starts tearing down and looking for volume BDMs so"},{"line_number":30,"context_line":"the compute manager can terminate the connection, detach the volume and,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7a740942_ac3831a1","line":27,"in_reply_to":"7a740942_040fede1","updated":"2015-12-11 15:21:06.000000000","message":"Looking at the logs, I think this is where the os-attach response comes back from cinder:\n\nhttp://logs.openstack.org/20/218120/3/check/gate-tempest-dsvm-full-ceph/2349f2d/logs/screen-n-cpu.txt.gz#_2015-12-07_05_51_13_891\n\nAfter which we\u0027d be calling self._bdm_obj.save() in DriverBlockDevice.\n\nRight after that we start terminating the instance:\n\nhttp://logs.openstack.org/20/218120/3/check/gate-tempest-dsvm-full-ceph/2349f2d/logs/screen-n-cpu.txt.gz#_2015-12-07_05_51_13_998\n\nHere is where the build lock is broken by the UnexpectedDeletingTaskStateError:\n\nhttp://logs.openstack.org/20/218120/3/check/gate-tempest-dsvm-full-ceph/2349f2d/logs/screen-n-cpu.txt.gz#_2015-12-07_05_51_15_280\n\nAnd yeah we can see here that the instance uuid lock is released by build and acquired by terminate:\n\nhttp://logs.openstack.org/20/218120/3/check/gate-tempest-dsvm-full-ceph/2349f2d/logs/screen-n-cpu.txt.gz#_2015-12-07_05_51_15_561\n\nSo I\u0027m OK with removing the save() calls in the DriverBlockDevice code since refreshing in _shutdown_instance *should* fix this particular race bug.","commit_id":"21fc72667d962935913113a4ac37c0019fea2196"}],"nova/compute/manager.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"95f23dc3673e41ce48b5c1ffa627c023950704ee","unresolved":false,"context_lines":[{"line_number":2269,"context_line":"        network_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":2270,"context_line":""},{"line_number":2271,"context_line":"        # NOTE(vish) get bdms before destroying the instance"},{"line_number":2272,"context_line":"        vol_bdms \u003d [bdm for bdm in bdms if bdm.volume_id]"},{"line_number":2273,"context_line":"        block_device_info \u003d self._get_instance_block_device_info("},{"line_number":2274,"context_line":"            context, instance, bdms\u003dbdms)"},{"line_number":2275,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_2b517536","line":2272,"updated":"2015-12-07 23:10:02.000000000","message":"I am curious why the is_volume doesn\u0027t work here, but I can probably figure that out on my own no problem.  What jumps out is that perhaps is_volume is kinda borked maybe?","commit_id":"20cee3b49070d4b373a44cb5beeaa3dcd7409c4d"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"3f292e141335693e0d3fe8c6fcef7da6c8a0a024","unresolved":false,"context_lines":[{"line_number":2269,"context_line":"        network_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":2270,"context_line":""},{"line_number":2271,"context_line":"        # NOTE(vish) get bdms before destroying the instance"},{"line_number":2272,"context_line":"        vol_bdms \u003d [bdm for bdm in bdms if bdm.volume_id]"},{"line_number":2273,"context_line":"        block_device_info \u003d self._get_instance_block_device_info("},{"line_number":2274,"context_line":"            context, instance, bdms\u003dbdms)"},{"line_number":2275,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_4c6cf0cd","line":2272,"in_reply_to":"7a740942_2b517536","updated":"2015-12-08 15:05:37.000000000","message":"This change looks good, given the usage below.  But is_volume does seem broken if this can be considered a volume with no volume_id.","commit_id":"20cee3b49070d4b373a44cb5beeaa3dcd7409c4d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ba5b3328613f701045faaa695ce2e4bfc58d7c02","unresolved":false,"context_lines":[{"line_number":2269,"context_line":"        network_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":2270,"context_line":""},{"line_number":2271,"context_line":"        # NOTE(vish) get bdms before destroying the instance"},{"line_number":2272,"context_line":"        vol_bdms \u003d [bdm for bdm in bdms if bdm.volume_id]"},{"line_number":2273,"context_line":"        block_device_info \u003d self._get_instance_block_device_info("},{"line_number":2274,"context_line":"            context, instance, bdms\u003dbdms)"},{"line_number":2275,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_642f803f","line":2272,"in_reply_to":"7a740942_4c6cf0cd","updated":"2015-12-08 15:51:11.000000000","message":"Yeah, is_volume checks if the dest_type is \u0027volume\u0027, the source_type can be \u0027volume\u0027, \u0027snapshot\u0027, \u0027image\u0027 or \u0027blank\u0027.  In the non-volume source type case, the block_device code (that is also touched in this change) creates a volume and then sets the volume_id, but we have this race where it *should* be a BDM volume but the volume_id isn\u0027t yet set when we get to this code path.","commit_id":"20cee3b49070d4b373a44cb5beeaa3dcd7409c4d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bb2521965e81e371f033da818d08417b28877e1a","unresolved":false,"context_lines":[{"line_number":2305,"context_line":"                # NOTE(vish): actual driver detach done in driver.destroy, so"},{"line_number":2306,"context_line":"                #             just tell cinder that we are done with it."},{"line_number":2307,"context_line":"                connector \u003d self.driver.get_volume_connector(instance)"},{"line_number":2308,"context_line":"                self.volume_api.terminate_connection(context,"},{"line_number":2309,"context_line":"                                                     bdm.volume_id,"},{"line_number":2310,"context_line":"                                                     connector)"},{"line_number":2311,"context_line":"                self.volume_api.detach(context, bdm.volume_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_0b07d9ca","line":2308,"updated":"2015-12-07 22:53:02.000000000","message":"We filter on bdm.volume_id above because that\u0027s what we use here.","commit_id":"20cee3b49070d4b373a44cb5beeaa3dcd7409c4d"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"effc6f50cf335d5a238fe8ba355c0b830bb11bdf","unresolved":false,"context_lines":[{"line_number":2269,"context_line":"        network_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":2270,"context_line":""},{"line_number":2271,"context_line":"        # NOTE(vish) get bdms before destroying the instance"},{"line_number":2272,"context_line":"        vol_bdms \u003d [bdm for bdm in bdms if bdm.volume_id]"},{"line_number":2273,"context_line":"        block_device_info \u003d self._get_instance_block_device_info("},{"line_number":2274,"context_line":"            context, instance, bdms\u003dbdms)"},{"line_number":2275,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_4299d41e","line":2272,"range":{"start_line":2272,"start_character":43,"end_line":2272,"end_character":56},"updated":"2015-12-09 16:28:22.000000000","message":"So this is obviously a hack - we really should maybe check this when deleting volumes and be vocal about the fact that there is a race, not filtering out something silently that should not be filtered out. I\u0027m am -1 on this alone.","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e2bc8e19e71be33cc0ffb76548893962ee1e9def","unresolved":false,"context_lines":[{"line_number":2269,"context_line":"        network_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":2270,"context_line":""},{"line_number":2271,"context_line":"        # NOTE(vish) get bdms before destroying the instance"},{"line_number":2272,"context_line":"        vol_bdms \u003d [bdm for bdm in bdms if bdm.volume_id]"},{"line_number":2273,"context_line":"        block_device_info \u003d self._get_instance_block_device_info("},{"line_number":2274,"context_line":"            context, instance, bdms\u003dbdms)"},{"line_number":2275,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_85ed86f1","line":2272,"in_reply_to":"7a740942_4299d41e","updated":"2015-12-09 16:37:13.000000000","message":"I\u0027d be OK with keeping this the way it was, but we\u0027d need to add a check for bdm.volume_id before calling volume_api.terminate_connection because otherwise we just get this:\n\nhttp://logs.openstack.org/20/218120/3/check/gate-tempest-dsvm-full-ceph/2349f2d/logs/screen-n-cpu.txt.gz#_2015-12-07_05_51_16_600\n\nAnd if volume_id isn\u0027t set, we\u0027d log a warning.","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"8e5312aa8fcd5c8cdbf0a8c332e82c791cd6413c","unresolved":false,"context_lines":[{"line_number":2269,"context_line":"        network_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":2270,"context_line":""},{"line_number":2271,"context_line":"        # NOTE(vish) get bdms before destroying the instance"},{"line_number":2272,"context_line":"        vol_bdms \u003d [bdm for bdm in bdms if bdm.volume_id]"},{"line_number":2273,"context_line":"        block_device_info \u003d self._get_instance_block_device_info("},{"line_number":2274,"context_line":"            context, instance, bdms\u003dbdms)"},{"line_number":2275,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_255ff276","line":2272,"in_reply_to":"7a740942_85ed86f1","updated":"2015-12-09 16:46:04.000000000","message":"yep that\u0027s what I meant","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4e6921c1314cef86126ad43692817e198a21718f","unresolved":false,"context_lines":[{"line_number":2322,"context_line":""},{"line_number":2323,"context_line":"            try:"},{"line_number":2324,"context_line":"                # NOTE(vish): actual driver detach done in driver.destroy,"},{"line_number":2325,"context_line":"                #             so just tell cinder that we are done with it."},{"line_number":2326,"context_line":"                connector \u003d self.driver.get_volume_connector(instance)"},{"line_number":2327,"context_line":"                self.volume_api.terminate_connection(context,"},{"line_number":2328,"context_line":"                                                     bdm.volume_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_bbbd3704","line":2325,"updated":"2015-12-09 22:01:52.000000000","message":"crap","commit_id":"e31759c532d82b80ecd6227dc97fbe0ac626caea"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4e6921c1314cef86126ad43692817e198a21718f","unresolved":false,"context_lines":[{"line_number":2340,"context_line":"                            instance\u003dinstance)"},{"line_number":2341,"context_line":"            except cinder_exception.ClientException as exc:"},{"line_number":2342,"context_line":"                LOG.warning(_LW(\u0027Ignoring Unknown cinder exception: %s\u0027),"},{"line_number":2343,"context_line":"                            exc, instance\u003dinstance)"},{"line_number":2344,"context_line":""},{"line_number":2345,"context_line":"        if vol_bdms:"},{"line_number":2346,"context_line":"            LOG.info(_LI(\u0027Took %(time).2f seconds to detach %(num)s volumes \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_7b36efb5","line":2343,"updated":"2015-12-09 22:01:52.000000000","message":"double crap","commit_id":"e31759c532d82b80ecd6227dc97fbe0ac626caea"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"131582fbbc961d538ca47a722004a5549c28143e","unresolved":false,"context_lines":[{"line_number":2312,"context_line":"            # into the API or conductor so we at least have the volume_id"},{"line_number":2313,"context_line":"            # before we get to the compute and start attaching. Then in case of"},{"line_number":2314,"context_line":"            # a delete we can rollback the volume cleanly."},{"line_number":2315,"context_line":"            if not bdm.volume_id:"},{"line_number":2316,"context_line":"                # Log a warning since we expect a volume bdm to have volume_id"},{"line_number":2317,"context_line":"                # set and if not we could leak volumes that we created."},{"line_number":2318,"context_line":"                LOG.warning(_LW(\u0027Possible leaked volume since volume_id is \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a740942_3134d1dc","line":2315,"updated":"2015-12-10 17:27:22.000000000","message":"Nikola and I were talking about this in IRC and the other race issue here is the compute API is what actually gets the BDMs and passes them over RPC to the compute, which we\u0027re using here.\n\nIf the DriverBlockDevice has saved off the volume_id to the database before we get here, if we got the BDMs from the API before that update happened, the DB is current by the BDM object is stale, and we don\u0027t have the volume_id.\n\nSo in this case, we should reload from the database probably.","commit_id":"8a29efd00e50852f1c01dfae46d7274a7e6552da"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"fd2adb15d82688c59991644576b0412328f65c4c","unresolved":false,"context_lines":[{"line_number":2314,"context_line":"                LOG.debug(\u0027There are potentially stale BDMs during delete, \u0027"},{"line_number":2315,"context_line":"                          \u0027refreshing the BlockDeviceMappingList.\u0027,"},{"line_number":2316,"context_line":"                          instance\u003dinstance)"},{"line_number":2317,"context_line":"                bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":2318,"context_line":"                    context, instance.uuid)"},{"line_number":2319,"context_line":"                # now filter the list again"},{"line_number":2320,"context_line":"                vol_bdms \u003d [bdm for bdm in bdms if bdm.is_volume]"},{"line_number":2321,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_29a2044c","line":2318,"range":{"start_line":2317,"start_character":16,"end_line":2318,"end_character":43},"updated":"2015-12-11 10:18:28.000000000","message":"As discussed on IRC - I\u0027d slightly prefer this to be done every time, as not having a volume_id may not cover all cases when we do need to refresh. but this is OK too.","commit_id":"21fc72667d962935913113a4ac37c0019fea2196"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"764a97271659f1e8be98eedc8961003fa47b6b6f","unresolved":false,"context_lines":[{"line_number":2315,"context_line":"                          \u0027refreshing the BlockDeviceMappingList.\u0027,"},{"line_number":2316,"context_line":"                          instance\u003dinstance)"},{"line_number":2317,"context_line":"                bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":2318,"context_line":"                    context, instance.uuid)"},{"line_number":2319,"context_line":"                # now filter the list again"},{"line_number":2320,"context_line":"                vol_bdms \u003d [bdm for bdm in bdms if bdm.is_volume]"},{"line_number":2321,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_2af8a4c2","line":2318,"in_reply_to":"7a740942_29a2044c","updated":"2015-12-11 15:21:06.000000000","message":"I just wanted to cut down on unnecessary traffic back to conductor if we can avoid it.\n\nUltimately I wouldn\u0027t mind just removing passing the bdms from API to compute and just let compute look them up every time on it\u0027s own, but that\u0027s an RPC API change and I can\u0027t backport it.","commit_id":"21fc72667d962935913113a4ac37c0019fea2196"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"909a639bafc797efb9cec79e7086d8ba92536719","unresolved":false,"context_lines":[{"line_number":2315,"context_line":"                          \u0027refreshing the BlockDeviceMappingList.\u0027,"},{"line_number":2316,"context_line":"                          instance\u003dinstance)"},{"line_number":2317,"context_line":"                bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":2318,"context_line":"                    context, instance.uuid)"},{"line_number":2319,"context_line":"                # now filter the list again"},{"line_number":2320,"context_line":"                vol_bdms \u003d [bdm for bdm in bdms if bdm.is_volume]"},{"line_number":2321,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_6fc79b98","line":2318,"in_reply_to":"7a740942_2af8a4c2","updated":"2015-12-11 15:33:07.000000000","message":"Is the for loop above going to pick this up properly?  I\u0027m leaning towards the same as Nikola and doing this every time.","commit_id":"21fc72667d962935913113a4ac37c0019fea2196"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"3be6bf3e2cbc979d08fc00ee46f118dffa03c832","unresolved":false,"context_lines":[{"line_number":2315,"context_line":"                          \u0027refreshing the BlockDeviceMappingList.\u0027,"},{"line_number":2316,"context_line":"                          instance\u003dinstance)"},{"line_number":2317,"context_line":"                bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":2318,"context_line":"                    context, instance.uuid)"},{"line_number":2319,"context_line":"                # now filter the list again"},{"line_number":2320,"context_line":"                vol_bdms \u003d [bdm for bdm in bdms if bdm.is_volume]"},{"line_number":2321,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_b5bdd469","line":2318,"in_reply_to":"7a740942_6fc79b98","updated":"2015-12-11 16:10:18.000000000","message":"Nvm, I missed the break.  This is not modifying the list being iterated over and expecting to continue iterating.","commit_id":"21fc72667d962935913113a4ac37c0019fea2196"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"fd2adb15d82688c59991644576b0412328f65c4c","unresolved":false,"context_lines":[{"line_number":2324,"context_line":"        for bdm in vol_bdms:"},{"line_number":2325,"context_line":"            # Make sure the driver block device code has set the volume_id on"},{"line_number":2326,"context_line":"            # the bdm before we try detaching it."},{"line_number":2327,"context_line":"            if not bdm.volume_id:"},{"line_number":2328,"context_line":"                # Log a warning since we expect a volume bdm to have volume_id"},{"line_number":2329,"context_line":"                # set and if not we could leak volumes that we created. This"},{"line_number":2330,"context_line":"                # could be caused by a race when we\u0027re told to delete the"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_44ff3501","line":2327,"range":{"start_line":2327,"start_character":12,"end_line":2327,"end_character":33},"updated":"2015-12-11 10:18:28.000000000","message":"I am not convinced we need that one. As discussed on the commit message. Let\u0027s keep fixes focused, see if refreshing fixes it and then take it from there.\n\nWe already log a volume_not_found below - that should be enough.","commit_id":"21fc72667d962935913113a4ac37c0019fea2196"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"fd2adb15d82688c59991644576b0412328f65c4c","unresolved":false,"context_lines":[{"line_number":2345,"context_line":"            except exception.DiskNotFound as exc:"},{"line_number":2346,"context_line":"                LOG.debug(\u0027Ignoring DiskNotFound: %s\u0027, exc,"},{"line_number":2347,"context_line":"                          instance\u003dinstance)"},{"line_number":2348,"context_line":"            except exception.VolumeNotFound as exc:"},{"line_number":2349,"context_line":"                LOG.debug(\u0027Ignoring VolumeNotFound: %s\u0027, exc,"},{"line_number":2350,"context_line":"                          instance\u003dinstance)"},{"line_number":2351,"context_line":"            except (cinder_exception.EndpointNotFound,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_c47c8522","line":2348,"range":{"start_line":2348,"start_character":30,"end_line":2348,"end_character":42},"updated":"2015-12-11 10:18:28.000000000","message":"here","commit_id":"21fc72667d962935913113a4ac37c0019fea2196"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"6a500cbd0e9b97f322eccebf2e7c1a27855420ea","unresolved":false,"context_lines":[{"line_number":2334,"context_line":"            except exception.DiskNotFound as exc:"},{"line_number":2335,"context_line":"                LOG.debug(\u0027Ignoring DiskNotFound: %s\u0027, exc,"},{"line_number":2336,"context_line":"                          instance\u003dinstance)"},{"line_number":2337,"context_line":"            except exception.VolumeNotFound as exc:"},{"line_number":2338,"context_line":"                LOG.debug(\u0027Ignoring VolumeNotFound: %s\u0027, exc,"},{"line_number":2339,"context_line":"                          instance\u003dinstance)"},{"line_number":2340,"context_line":"            except (cinder_exception.EndpointNotFound,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_8014144d","line":2337,"updated":"2015-12-11 16:30:42.000000000","message":"We\u0027re relying on the terminate_connection to raise this if volume_id is not set.  But as far as I can determine this still requires cinderclient to make a request to Cinder even if volume_id is not set.  It would be better to not make the request if volume_id is not set.  Which should only occur in a failure to create the volume, not due to the race being addressed here.","commit_id":"4f2a46987cf705d5dea84e97ef2006342cc5d9c4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"29024d5a4e74b1eade6b37c4f56cbbfd55c6fd88","unresolved":false,"context_lines":[{"line_number":2334,"context_line":"            except exception.DiskNotFound as exc:"},{"line_number":2335,"context_line":"                LOG.debug(\u0027Ignoring DiskNotFound: %s\u0027, exc,"},{"line_number":2336,"context_line":"                          instance\u003dinstance)"},{"line_number":2337,"context_line":"            except exception.VolumeNotFound as exc:"},{"line_number":2338,"context_line":"                LOG.debug(\u0027Ignoring VolumeNotFound: %s\u0027, exc,"},{"line_number":2339,"context_line":"                          instance\u003dinstance)"},{"line_number":2340,"context_line":"            except (cinder_exception.EndpointNotFound,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_b30ba923","line":2337,"in_reply_to":"7a740942_3b01d538","updated":"2015-12-11 17:23:19.000000000","message":"I\u0027d be OK with adding a check in another change since it\u0027s not the bug we\u0027re hitting here since we actually created the volume.","commit_id":"4f2a46987cf705d5dea84e97ef2006342cc5d9c4"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"3b56a3e6f3e179be58b15c41aa0a4a27dc7a8bb7","unresolved":false,"context_lines":[{"line_number":2334,"context_line":"            except exception.DiskNotFound as exc:"},{"line_number":2335,"context_line":"                LOG.debug(\u0027Ignoring DiskNotFound: %s\u0027, exc,"},{"line_number":2336,"context_line":"                          instance\u003dinstance)"},{"line_number":2337,"context_line":"            except exception.VolumeNotFound as exc:"},{"line_number":2338,"context_line":"                LOG.debug(\u0027Ignoring VolumeNotFound: %s\u0027, exc,"},{"line_number":2339,"context_line":"                          instance\u003dinstance)"},{"line_number":2340,"context_line":"            except (cinder_exception.EndpointNotFound,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_3b01d538","line":2337,"in_reply_to":"7a740942_8014144d","updated":"2015-12-11 16:48:27.000000000","message":"That\u0027s a fair point","commit_id":"4f2a46987cf705d5dea84e97ef2006342cc5d9c4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"52bb14208d56f2aa0cde70fd7dd94725bd41c849","unresolved":false,"context_lines":[{"line_number":2360,"context_line":""},{"line_number":2361,"context_line":"        for bdm in bdms:"},{"line_number":2362,"context_line":"            LOG.debug(\"terminating bdm %s\", bdm,"},{"line_number":2363,"context_line":"                      instance_uuid\u003dinstance_uuid)"},{"line_number":2364,"context_line":"            if bdm.volume_id and bdm.delete_on_termination:"},{"line_number":2365,"context_line":"                try:"},{"line_number":2366,"context_line":"                    self.volume_api.delete(context, bdm.volume_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a710552_641e2765","line":2363,"updated":"2015-12-15 19:13:09.000000000","message":"bdm.volume_id is still None if stale. :(\n\nI have to fix this.","commit_id":"4f2a46987cf705d5dea84e97ef2006342cc5d9c4"}],"nova/virt/block_device.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bb2521965e81e371f033da818d08417b28877e1a","unresolved":false,"context_lines":[{"line_number":521,"context_line":"                      \u0027mountpoint\u0027: bdm[\u0027mount_device\u0027]},"},{"line_number":522,"context_line":"                     context\u003dcontext, instance\u003dinstance)"},{"line_number":523,"context_line":"        elif bdm.snapshot_id:"},{"line_number":524,"context_line":"            LOG.info(_LI(\u0027Booting with snapshot %(snapshot_id)s at \u0027"},{"line_number":525,"context_line":"                         \u0027%(mountpoint)s\u0027),"},{"line_number":526,"context_line":"                     {\u0027snapshot_id\u0027: bdm.snapshot_id,"},{"line_number":527,"context_line":"                      \u0027mountpoint\u0027: bdm[\u0027mount_device\u0027]},"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_8bfbc9c0","line":524,"updated":"2015-12-07 22:53:02.000000000","message":"Should probably say \u0027volume snapshot\u0027 here.","commit_id":"20cee3b49070d4b373a44cb5beeaa3dcd7409c4d"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"95f23dc3673e41ce48b5c1ffa627c023950704ee","unresolved":false,"context_lines":[{"line_number":521,"context_line":"                      \u0027mountpoint\u0027: bdm[\u0027mount_device\u0027]},"},{"line_number":522,"context_line":"                     context\u003dcontext, instance\u003dinstance)"},{"line_number":523,"context_line":"        elif bdm.snapshot_id:"},{"line_number":524,"context_line":"            LOG.info(_LI(\u0027Booting with snapshot %(snapshot_id)s at \u0027"},{"line_number":525,"context_line":"                         \u0027%(mountpoint)s\u0027),"},{"line_number":526,"context_line":"                     {\u0027snapshot_id\u0027: bdm.snapshot_id,"},{"line_number":527,"context_line":"                      \u0027mountpoint\u0027: bdm[\u0027mount_device\u0027]},"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_ebadad9b","line":524,"in_reply_to":"7a740942_8bfbc9c0","updated":"2015-12-07 23:10:02.000000000","message":"For sure, it may be clear to some but would go a long way for users I think.","commit_id":"20cee3b49070d4b373a44cb5beeaa3dcd7409c4d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bb2521965e81e371f033da818d08417b28877e1a","unresolved":false,"context_lines":[{"line_number":527,"context_line":"                      \u0027mountpoint\u0027: bdm[\u0027mount_device\u0027]},"},{"line_number":528,"context_line":"                     context\u003dcontext, instance\u003dinstance)"},{"line_number":529,"context_line":"        elif bdm.image_id:"},{"line_number":530,"context_line":"            LOG.info(_LI(\u0027Booting with image %(image_id)s at \u0027"},{"line_number":531,"context_line":"                         \u0027%(mountpoint)s\u0027),"},{"line_number":532,"context_line":"                     {\u0027image_id\u0027: bdm.image_id,"},{"line_number":533,"context_line":"                      \u0027mountpoint\u0027: bdm[\u0027mount_device\u0027]},"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_0b2ef942","line":530,"updated":"2015-12-07 22:53:02.000000000","message":"\u0027Booting with image\u0027 is confusing in the logs, this should probably say something about booting from volume with image here.","commit_id":"20cee3b49070d4b373a44cb5beeaa3dcd7409c4d"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"95f23dc3673e41ce48b5c1ffa627c023950704ee","unresolved":false,"context_lines":[{"line_number":527,"context_line":"                      \u0027mountpoint\u0027: bdm[\u0027mount_device\u0027]},"},{"line_number":528,"context_line":"                     context\u003dcontext, instance\u003dinstance)"},{"line_number":529,"context_line":"        elif bdm.image_id:"},{"line_number":530,"context_line":"            LOG.info(_LI(\u0027Booting with image %(image_id)s at \u0027"},{"line_number":531,"context_line":"                         \u0027%(mountpoint)s\u0027),"},{"line_number":532,"context_line":"                     {\u0027image_id\u0027: bdm.image_id,"},{"line_number":533,"context_line":"                      \u0027mountpoint\u0027: bdm[\u0027mount_device\u0027]},"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_8b7e6917","line":530,"in_reply_to":"7a740942_0b2ef942","updated":"2015-12-07 23:10:02.000000000","message":"We\u0027ve used \"volume-backed image\" in the past as a term, might be a good chance to try and proliferate that if others don\u0027t hate it.","commit_id":"20cee3b49070d4b373a44cb5beeaa3dcd7409c4d"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"3f292e141335693e0d3fe8c6fcef7da6c8a0a024","unresolved":false,"context_lines":[{"line_number":527,"context_line":"                      \u0027mountpoint\u0027: bdm[\u0027mount_device\u0027]},"},{"line_number":528,"context_line":"                     context\u003dcontext, instance\u003dinstance)"},{"line_number":529,"context_line":"        elif bdm.image_id:"},{"line_number":530,"context_line":"            LOG.info(_LI(\u0027Booting with image %(image_id)s at \u0027"},{"line_number":531,"context_line":"                         \u0027%(mountpoint)s\u0027),"},{"line_number":532,"context_line":"                     {\u0027image_id\u0027: bdm.image_id,"},{"line_number":533,"context_line":"                      \u0027mountpoint\u0027: bdm[\u0027mount_device\u0027]},"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_d14ddb9a","line":530,"in_reply_to":"7a740942_8b7e6917","updated":"2015-12-08 15:05:37.000000000","message":"volume-backed-image is properly descriptive IMO.","commit_id":"20cee3b49070d4b373a44cb5beeaa3dcd7409c4d"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"effc6f50cf335d5a238fe8ba355c0b830bb11bdf","unresolved":false,"context_lines":[{"line_number":398,"context_line":"            # have the volume_id on the BDM in case a delete request comes in"},{"line_number":399,"context_line":"            # while we\u0027re attaching, so we can at least attempt to delete the"},{"line_number":400,"context_line":"            # volume that we created."},{"line_number":401,"context_line":"            self.save()"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"        # Call the volume attach now"},{"line_number":404,"context_line":"        super(DriverSnapshotBlockDevice, self).attach("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_e26b20f0","line":401,"range":{"start_line":401,"start_character":12,"end_line":401,"end_character":23},"updated":"2015-12-09 16:28:22.000000000","message":"Neither of these really fix the race - they only make the window smaller. We should be super explicit about it.","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e2bc8e19e71be33cc0ffb76548893962ee1e9def","unresolved":false,"context_lines":[{"line_number":398,"context_line":"            # have the volume_id on the BDM in case a delete request comes in"},{"line_number":399,"context_line":"            # while we\u0027re attaching, so we can at least attempt to delete the"},{"line_number":400,"context_line":"            # volume that we created."},{"line_number":401,"context_line":"            self.save()"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"        # Call the volume attach now"},{"line_number":404,"context_line":"        super(DriverSnapshotBlockDevice, self).attach("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_45931e50","line":401,"in_reply_to":"7a740942_e26b20f0","updated":"2015-12-09 16:37:13.000000000","message":"I can update the comment to say that this doesn\u0027t eliminate the race but it should narrow the window.\n\nIf you want to go through:\n\nhttps://bugs.launchpad.net/cinder/+bug/1464259/comments/13\n\nYou\u0027ll see that I\u0027ve tracked where we\u0027ve successfully created the volume and started attaching by the time the delete request comes in and we fail to delete the volume, because volume_id isn\u0027t set on the bdm when the compute manager starts tearing down:\n\nhttp://logs.openstack.org/20/218120/3/check/gate-tempest-dsvm-full-ceph/2349f2d/logs/screen-n-cpu.txt.gz#_2015-12-07_05_51_16_600","commit_id":"0d7f1c8f32d56b94d323c95d06830eeb9a821ada"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"fd2adb15d82688c59991644576b0412328f65c4c","unresolved":false,"context_lines":[{"line_number":399,"context_line":"            # while we\u0027re attaching, so we can at least attempt to delete the"},{"line_number":400,"context_line":"            # volume that we created. This does not entirely avoid a race with"},{"line_number":401,"context_line":"            # leaking volumes but it should at least narrow a race window."},{"line_number":402,"context_line":"            self.save()"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        # Call the volume attach now"},{"line_number":405,"context_line":"        super(DriverSnapshotBlockDevice, self).attach("}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_8490bd96","line":402,"range":{"start_line":402,"start_character":12,"end_line":402,"end_character":23},"updated":"2015-12-11 10:18:28.000000000","message":"I am not convinced we need this for this particular bug. It might help things, but it\u0027s best to keep the fixes as targeted as possible.","commit_id":"21fc72667d962935913113a4ac37c0019fea2196"}]}
