diff --git a/agent/proxycfg/state.go b/agent/proxycfg/state.go index 24141d4d7b..a296698a1b 100644 --- a/agent/proxycfg/state.go +++ b/agent/proxycfg/state.go @@ -317,7 +317,10 @@ func (s *state) run(ctx context.Context, snap *ConfigSnapshot) { // This runs in another goroutine so we can't just do the send // directly here as access to snap is racy. Instead, signal the main // loop above. - sendCh <- struct{}{} + select { + case sendCh <- struct{}{}: + case <-ctx.Done(): + } }) }