Repository navigation
Conversation
Signed-off-by: Tomas Bredar <tomas.bredar@telekom.sk>
bredy0
force-pushed
the
fix/writechangeid-guard-and-reauth
branch
from
September 24, 2026 09:33
a28cea5 to
62040ad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two related issues surface on long‑running migrations (large disks / slow links), where the Keystone token can expire mid‑copy:
No token refresh. NewClientSet builds the provider from AuthOptionsFromEnv() but never sets AllowReauth, so the token obtained at start is never renewed. A migration that runs longer than the token TTL fails its end‑of‑copy Cinder calls with 401 Unauthorized. Fix: opts.AllowReauth = true (credentials come from env, so gophercloud can re‑authenticate transparently).
WriteChangeID panics on any non‑"not found" error. It only handles ErrorVolumeNotFound from GetVolumeForDisk; for any other error (incl. the 401 above, "multiple volumes found", or a list/get error) it falls through and dereferences a nil volume, crashing the process after the copy completed and leaving the target volume attached. GetCurrentChangeID already has the correct guard. Fix: add else if err != nil { return err } and initialise volume.Metadata if nil.
Together: long copies now complete (token refreshes), and any genuine volume‑lookup error is returned cleanly and retryably instead of crashing.