Keep stale virtual member copy when the remote lookup fails
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful

This commit is contained in:
2026-10-25 19:06:58 +11:00
parent e5313342ba
commit de80fd84c2
2 changed files with 17 additions and 2 deletions
+2 -2
View File
@@ -548,8 +548,8 @@ func (e *Engine) fetchAlpineMember(ctx context.Context, name, dir string) (*Alpi
// the background, one refresh per member at a time; the next merge picks it up.
func staleMember[T any](ctx context.Context, e *Engine, key, name string, fetch func(context.Context) (*T, error)) (*T, error) {
sk := key + "\x00" + name
remote, err := e.getRemote(ctx, name)
if err != nil || !remote.ServeStale {
// A failed lookup keeps the copy: a transient DB error must not force a blocking fetch.
if remote, err := e.getRemote(ctx, name); err == nil && !remote.ServeStale {
e.mu.Lock()
delete(e.stale, sk)
e.mu.Unlock()