Skip to content

Commit

Permalink
Merge pull request #12017 from nalind/exponential
Browse files Browse the repository at this point in the history
Use exponential backoff when waiting for a journal entry
  • Loading branch information
openshift-merge-robot authored Oct 20, 2021
2 parents a3dba7f + db7a98d commit 97f051f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libpod/container_log_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97f051f

Please sign in to comment.