From 856e5ab8bec16a2a2d0e11eac1a23186eecc0d5f Mon Sep 17 00:00:00 2001 From: zengfanwei Date: Fri, 2 Apr 2021 20:38:25 +0800 Subject: [PATCH] fix panic: sync: negative WaitGroup counter --- registry/zookeeper/registry.go | 1 + 1 file changed, 1 insertion(+) diff --git a/registry/zookeeper/registry.go b/registry/zookeeper/registry.go index 8b21aaed73..f67f98465d 100644 --- a/registry/zookeeper/registry.go +++ b/registry/zookeeper/registry.go @@ -79,6 +79,7 @@ func newZkRegistry(url *common.URL) (registry.Registry, error) { return nil, err } + r.WaitGroup().Add(1) //zk client start successful, then wg +1 go zookeeper.HandleClientRestart(r) r.listener = zookeeper.NewZkEventListener(r.client)