Skip to content
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

o/snapstate: download, link, unlink, and discard snap icon in snapstate handlers #15070

Merged
Prev Previous commit
Next Next commit
o/snapstate: test that state lock is not held during icon download
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
  • Loading branch information
olivercalder committed Feb 20, 2025
commit 1e4c4304af681e7eade6bd89fec48a4e92aa118b
3 changes: 3 additions & 0 deletions overlord/snapstate/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,9 @@ func (f *fakeStore) Download(ctx context.Context, name, targetFn string, snapInf
}

func (f *fakeStore) DownloadIcon(ctx context.Context, name string, targetPath string, downloadURL string) error {
// we don't want to hold state lock while waiting on the icon download
f.pokeStateLock()

if f.downloadIconCallback != nil {
f.downloadIconCallback(targetPath)
}
Expand Down