From dd7c4da0ebb558bc1d5d4100c088c30970e21da4 Mon Sep 17 00:00:00 2001 From: Alexander Renz Date: Fri, 16 Jan 2026 16:08:42 +0100 Subject: [PATCH] fix(restore): add 100ms delay between database restores Ensures PostgreSQL fully closes connections before starting next restore, preventing potential connection pool exhaustion during rapid sequential cluster restores. --- internal/restore/engine.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/restore/engine.go b/internal/restore/engine.go index a7df623..daa077a 100755 --- a/internal/restore/engine.go +++ b/internal/restore/engine.go @@ -1203,6 +1203,9 @@ func (e *Engine) RestoreCluster(ctx context.Context, archivePath string) error { completedDBTimesMu.Unlock() atomic.AddInt32(&successCount, 1) + + // Small delay to ensure PostgreSQL fully closes connections before next restore + time.Sleep(100 * time.Millisecond) }(dbIndex, entry.Name()) dbIndex++