diff --git a/cluster/router/chain/chain.go b/cluster/router/chain/chain.go index 091bcaa051292d32fbd97d3f599366ffd115255a..1c7d48aef99a13ab5dc63c7eb7ead533b1a3ac63 100644 --- a/cluster/router/chain/chain.go +++ b/cluster/router/chain/chain.go @@ -188,9 +188,9 @@ func (c *RouterChain) buildCache() { go func(p router.Poolable) { pool, info := poolRouter(p, origin, invokers) mutex.Lock() + defer mutex.Unlock() cache.pools[p.Name()] = pool cache.metadatas[p.Name()] = info - mutex.Unlock() wg.Done() }(p) }