Skip to content

Commit

Permalink
Fix restart delay when agent process exits unexpectedly
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanthccv committed Dec 31, 2023
1 parent 2008304 commit a67a02c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/opampsupervisor/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,9 @@ func (s *Supervisor) runAgentProcess() {
// https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/21079

// Wait 5 seconds before starting again.
restartTimer.Stop()
if !restartTimer.Stop() {
<-restartTimer.C
}
restartTimer.Reset(5 * time.Second)

case <-restartTimer.C:
Expand Down

0 comments on commit a67a02c

Please sign in to comment.