-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HMS-5244: fix snapshot task cleanup #939
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
err = sh.payload.SaveSnapshotIdent(snap.UUID) | ||
if err != nil { | ||
return fmt.Errorf("unable to save snapshot ident: %w", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little confusing, but the SnapshotIdent is set previously and it's actually not the snapshot UUID, just a random UUID, because the snapshot object has not been created yet.
I see that you're setting it so that the snapshot can be deleted, which I think makes sense. To avoid conflating the two values, it probably makes sense to make a new "SnapshotUUID" field for the purpose of tracking snapshot creation?
err = sh.payload.SaveDistributionTaskHref(snap.DistributionHref) | ||
if err != nil { | ||
return fmt.Errorf("unable to save distribution task href: %w", err) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the distribution task href is saved earlier in the function, so I think it's okay to remove this
Summary
This PR fixes up the snapshot task's cleanup that happens on context cancellation. This caused errors that were being reported by glitchtip.
(
error deleting rpm repository versions: 400 Bad Request: [\"The repository version cannot be deleted because it (or its publications) are currently being used to distribute content. Please update the necessary distributions first.\"]
)Testing steps