summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-10-20 12:49:10 +0000
committerGitHub <noreply@github.com>2021-10-20 12:49:10 +0000
commit97f051f65769fed32b3c497b3f484667400c66a9 (patch)
treeabc8fee0e78cb126ac6d6f63db1da5378c807cec
parenta3dba7fdfb9faa0ac0fdd7a2f792a15165dda64d (diff)
parentdb7a98de40629b958d8867c36cf6f4998d335213 (diff)
downloadpodman-97f051f65769fed32b3c497b3f484667400c66a9.tar.gz
podman-97f051f65769fed32b3c497b3f484667400c66a9.tar.bz2
podman-97f051f65769fed32b3c497b3f484667400c66a9.zip
Merge pull request #12017 from nalind/exponential
Use exponential backoff when waiting for a journal entry
-rw-r--r--libpod/container_log_linux.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/libpod/container_log_linux.go b/libpod/container_log_linux.go
index ca1e11ef5..562169ce2 100644
--- a/libpod/container_log_linux.go
+++ b/libpod/container_log_linux.go
@@ -91,8 +91,12 @@ func (c *Container) readFromJournal(ctx context.Context, options *logs.LogOption
var cursorError error
for i := 1; i <= 3; i++ {
cursor, cursorError = journal.GetCursor()
+ hundreds := 1
+ for j := 1; j < i; j++ {
+ hundreds *= 2
+ }
if cursorError != nil {
- time.Sleep(time.Duration(i*100) * time.Millisecond)
+ time.Sleep(time.Duration(hundreds*100) * time.Millisecond)
continue
}
break