Skip to content

Commit

Permalink
plugins/logs: Fix broken retry logic
Browse files Browse the repository at this point in the history
We were incorrectly resetting the retry counter after
every error condition instead of using the incremented
value. As a result, retry delay would always be 0s.
This meant that if OPA encountered an error while
uploading decision logs it would immediately retry
instead of doing an exponential backoff.

Fixes: #4486

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
  • Loading branch information
ashutosh-narkar committed Mar 25, 2022
1 parent 598b7e2 commit c08b81d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/logs/plugin.go
Expand Up @@ -661,9 +661,10 @@ func (p *Plugin) loop() {

ctx, cancel := context.WithCancel(context.Background())

var retry int

for {

var retry int
var waitC chan struct{}

if *p.config.Reporting.Trigger == plugins.TriggerPeriodic && p.config.Service != "" {
Expand Down

0 comments on commit c08b81d

Please sign in to comment.