fix: new control plane should reset grpc conn pool cache (#150)

This commit is contained in:
mzz
2023-06-18 18:53:26 +08:00
committed by GitHub
parent d3dcfe6bb5
commit 4d42b2d978
4 changed files with 10 additions and 6 deletions

View File

@ -35,6 +35,7 @@ import (
"github.com/mohae/deepcopy"
"github.com/mzz2017/softwind/pool"
"github.com/mzz2017/softwind/protocol/direct"
"github.com/mzz2017/softwind/transport/grpc"
"github.com/sirupsen/logrus"
"golang.org/x/net/dns/dnsmessage"
"golang.org/x/sys/unix"
@ -262,6 +263,8 @@ func NewControlPlane(
}
// Filter out groups.
// FIXME: Ugly code here: reset grpc clients manually.
grpc.CleanGlobalClientConnectionCache()
dialerSet := outbound.NewDialerSetFromLinks(option, tagToNodeList)
deferFuncs = append(deferFuncs, dialerSet.Close)
for _, group := range groups {