Skip to content

Commit

Permalink
pkg/system: reduce retry timeout for EnsureRemoveAll
Browse files Browse the repository at this point in the history
reduce the waiting time for attempting again the removal to 10ms
instead of the current 100ms.

Currently, if we hit the timeout, we add an artificial 100ms delay to
the container cleanup, while with this we will react faster when the
removal is possible.

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Sep 29, 2023
1 parent c5223a7 commit 89dabb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/system/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func EnsureRemoveAll(dir string) error {

// track retries
exitOnErr := make(map[string]int)
maxRetry := 100
maxRetry := 1000

// Attempt a simple remove all first, this avoids the more expensive
// RecursiveUnmount call if not needed.
Expand Down Expand Up @@ -94,6 +94,6 @@ func EnsureRemoveAll(dir string) error {
return err
}
exitOnErr[pe.Path]++
time.Sleep(100 * time.Millisecond)
time.Sleep(10 * time.Millisecond)
}
}

0 comments on commit 89dabb2

Please sign in to comment.