From 6024953571aaa49062b4162484ef93b17c2e457f Mon Sep 17 00:00:00 2001 From: Evan Jarrett Date: Sat, 25 Oct 2025 19:58:29 -0500 Subject: [PATCH] try and recover from panic? --- pkg/appview/storage/manifest_store.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/appview/storage/manifest_store.go b/pkg/appview/storage/manifest_store.go index 44ec3d2..499ad62 100644 --- a/pkg/appview/storage/manifest_store.go +++ b/pkg/appview/storage/manifest_store.go @@ -192,6 +192,11 @@ func (s *ManifestStore) Put(ctx context.Context, manifest distribution.Manifest, // Do this asynchronously to avoid blocking the push if tag != "" && s.ctx.ServiceToken != "" && s.ctx.Handle != "" { go func() { + defer func() { + if r := recover(); r != nil { + slog.Error("Panic in notifyHoldAboutManifest", "panic", r) + } + }() if err := s.notifyHoldAboutManifest(context.Background(), manifestRecord, tag, dgst.String()); err != nil { slog.Warn("Failed to notify hold about manifest", "error", err) } @@ -201,6 +206,11 @@ func (s *ManifestStore) Put(ctx context.Context, manifest distribution.Manifest, // Refresh README cache asynchronously if manifest has io.atcr.readme annotation // This ensures fresh README content is available on repository pages go func() { + defer func() { + if r := recover(); r != nil { + slog.Error("Panic in refreshReadmeCache", "panic", r) + } + }() s.refreshReadmeCache(context.Background(), manifestRecord) }()