{"action":"created","issue":{"url":"https://api.github.com/repos/lxc/lxd/issues/2141","repository_url":"https://api.github.com/repos/lxc/lxd","labels_url":"https://api.github.com/repos/lxc/lxd/issues/2141/labels{/name}","comments_url":"https://api.github.com/repos/lxc/lxd/issues/2141/comments","events_url":"https://api.github.com/repos/lxc/lxd/issues/2141/events","html_url":"https://github.com/lxc/lxd/pull/2141","id":161292631,"number":2141,"title":"Use defer to undo changes on failed update","user":{"login":"sean-jc","id":18535971,"avatar_url":"https://avatars.githubusercontent.com/u/18535971?v=3","gravatar_id":"","url":"https://api.github.com/users/sean-jc","html_url":"https://github.com/sean-jc","followers_url":"https://api.github.com/users/sean-jc/followers","following_url":"https://api.github.com/users/sean-jc/following{/other_user}","gists_url":"https://api.github.com/users/sean-jc/gists{/gist_id}","starred_url":"https://api.github.com/users/sean-jc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sean-jc/subscriptions","organizations_url":"https://api.github.com/users/sean-jc/orgs","repos_url":"https://api.github.com/users/sean-jc/repos","events_url":"https://api.github.com/users/sean-jc/events{/privacy}","received_events_url":"https://api.github.com/users/sean-jc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-06-20T20:56:42Z","updated_at":"2016-06-21T15:34:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/lxc/lxd/pulls/2141","html_url":"https://github.com/lxc/lxd/pull/2141","diff_url":"https://github.com/lxc/lxd/pull/2141.diff","patch_url":"https://github.com/lxc/lxd/pull/2141.patch"},"body":"Defer the function to undo changes and track whether or not the changes\r\nshould be kept using a closure over a bool.  This eliminates the need to\r\nexplicitly call undoChanges() in every failing return path.\r\n\r\nSigned-off-by: Sean Christopherson <sean.j.christopherson@intel.com>"},"comment":{"url":"https://api.github.com/repos/lxc/lxd/issues/comments/227478989","html_url":"https://github.com/lxc/lxd/pull/2141#issuecomment-227478989","issue_url":"https://api.github.com/repos/lxc/lxd/issues/2141","id":227478989,"user":{"login":"sean-jc","id":18535971,"avatar_url":"https://avatars.githubusercontent.com/u/18535971?v=3","gravatar_id":"","url":"https://api.github.com/users/sean-jc","html_url":"https://github.com/sean-jc","followers_url":"https://api.github.com/users/sean-jc/followers","following_url":"https://api.github.com/users/sean-jc/following{/other_user}","gists_url":"https://api.github.com/users/sean-jc/gists{/gist_id}","starred_url":"https://api.github.com/users/sean-jc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sean-jc/subscriptions","organizations_url":"https://api.github.com/users/sean-jc/orgs","repos_url":"https://api.github.com/users/sean-jc/repos","events_url":"https://api.github.com/users/sean-jc/events{/privacy}","received_events_url":"https://api.github.com/users/sean-jc/received_events","type":"User","site_admin":false},"created_at":"2016-06-21T15:34:47Z","updated_at":"2016-06-21T15:34:47Z","body":"This is just speculation based on the commit message for eb2a87f8d939499a556b6e1c409ea2abd096318e as I haven't done a deep dive into the migration flow...\r\n\r\nMy understanding is that `sendControl(err)` informs the migration source that the migration failed.  Deferring `driver.Cleanup` but not `sendControl` creates a race condition where the source learns of the failure and starts doing \"something\", and that \"something\" conflicts with `driver.Cleanup`."}}
{"actor":{"display_login":"sean-jc"}}