Skip to content

Commit

Permalink
envoy: remove unnecessary wait and log message after starting envoy
Browse files Browse the repository at this point in the history
When the envoy proxy gets started by the Cilium Agent, the
message `Envoy: Sleeping for 100ms before restarting proxy` gets logged.

With the introduction of supervising the Envoy Proxy in a dedicated
go-routine, this message and the corresponding wait is somewhat
unnecessary and gets deleted with this commit.

Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
  • Loading branch information
mhofstetter authored and borkmann committed Mar 22, 2023
1 parent 44756ba commit 0ec790a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/envoy/envoy.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,12 @@ func StartEnvoy(stateDir, logPath string, baseID uint64) *Envoy {
go func() {
if err := cmd.Wait(); err != nil {
log.WithError(err).Warn("Envoy: Proxy crashed")
// Avoid busy loop & hogging CPU resources by waiting before restarting envoy.
time.Sleep(100 * time.Millisecond)
}
close(crashCh)
}()

// start again after a short wait. If Cilium exits this should be enough
// time to not start Envoy again in that case.
log.Info("Envoy: Sleeping for 100ms before restarting proxy")
time.Sleep(100 * time.Millisecond)

select {
case <-crashCh:
// Start Envoy again
Expand Down

0 comments on commit 0ec790a

Please sign in to comment.