From d91ced4ba0f8503ec328febe3fb860ccf43c4fe6 Mon Sep 17 00:00:00 2001 From: "binbin.zhang" Date: Sat, 12 Feb 2022 14:18:16 +0800 Subject: [PATCH] config listen execute max chan (#403) --- clients/config_client/config_client.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clients/config_client/config_client.go b/clients/config_client/config_client.go index 12fdc8f6..0189e7de 100644 --- a/clients/config_client/config_client.go +++ b/clients/config_client/config_client.go @@ -19,6 +19,7 @@ package config_client import ( "errors" "fmt" + "math" "os" "strings" "sync" @@ -116,8 +117,8 @@ func NewConfigClient(nc nacos_client.INacosClient) (*ConfigClient, error) { config.uid = uid.String() config.cacheMap = cache.NewConcurrentMap() - - config.listenExecute = make(chan struct{}, 1) + // maximum buffered queue to prevent chan deadlocks during frequent configuration file updates + config.listenExecute = make(chan struct{}, math.MaxInt64) config.startInternal()