diff --git a/pkg/agent/poller/client.go b/pkg/agent/poller/client.go index d8cc6c60c..948ee23ca 100644 --- a/pkg/agent/poller/client.go +++ b/pkg/agent/poller/client.go @@ -86,7 +86,10 @@ func (p *PollClient) Start() error { if p.onStreamConnection != nil { p.onStreamConnection() } + + p.mutex.Lock() p.initialized = true + p.mutex.Unlock() select { case err := <-listenCh: