diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9a2ebaa6b..ce6d3e2e6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -92,8 +92,8 @@ jobs: - name: Set up Env run: | - echo "::set-env name=GOPATH::$(go env GOPATH)" - echo "::add-path::$(go env GOPATH)/bin" + echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - name: Check out code into the Go module directory uses: actions/checkout@v2 diff --git a/go.mod b/go.mod index d8c80fc05..8e2f518a7 100644 --- a/go.mod +++ b/go.mod @@ -32,6 +32,7 @@ require ( github.com/leodido/go-urn v1.1.0 // indirect github.com/mattn/go-colorable v0.1.4 // indirect github.com/mattn/go-isatty v0.0.10 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/montanaflynn/stats v0.5.0 github.com/openzipkin/zipkin-go v0.2.1 github.com/otokaze/mock v0.0.0-20190125081256-8282b7a7c7c3 diff --git a/go.sum b/go.sum index d351be9ad..9de294c66 100644 --- a/go.sum +++ b/go.sum @@ -465,8 +465,6 @@ google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRn google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.28.1 h1:C1QC6KzgSiLyBabDi87BbjaGreoRgGUF5nOyvfrAZ1k= google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= diff --git a/pkg/container/pool/list.go b/pkg/container/pool/list.go index 97e9afc5c..7155953e6 100644 --- a/pkg/container/pool/list.go +++ b/pkg/container/pool/list.go @@ -50,7 +50,6 @@ func NewList(c *Config) *List { // Reload reload config. func (p *List) Reload(c *Config) error { p.mu.Lock() - p.startCleanerLocked(time.Duration(c.IdleTimeout)) p.conf = c p.mu.Unlock() return nil diff --git a/pkg/container/pool/slice.go b/pkg/container/pool/slice.go index 6876565ed..512ece39b 100644 --- a/pkg/container/pool/slice.go +++ b/pkg/container/pool/slice.go @@ -61,7 +61,6 @@ func NewSlice(c *Config) *Slice { // Reload reload config. func (p *Slice) Reload(c *Config) error { p.mu.Lock() - p.startCleanerLocked(time.Duration(c.IdleTimeout)) p.setActive(c.Active) p.setIdle(c.Idle) p.conf = c @@ -260,7 +259,6 @@ func (p *Slice) openNewItem(ctx context.Context) { // // If n <= 0, no idle items are retained. func (p *Slice) setIdle(n int) { - p.mu.Lock() if n > 0 { p.conf.Idle = n } else { @@ -278,7 +276,6 @@ func (p *Slice) setIdle(n int) { closing = p.freeItem[maxIdle:] p.freeItem = p.freeItem[:maxIdle] } - p.mu.Unlock() for _, c := range closing { c.close() } @@ -293,13 +290,11 @@ func (p *Slice) setIdle(n int) { // If n <= 0, then there is no limit on the number of open items. // The default is 0 (unlimited). func (p *Slice) setActive(n int) { - p.mu.Lock() p.conf.Active = n if n < 0 { p.conf.Active = 0 } syncIdle := p.conf.Active > 0 && p.maxIdleItemsLocked() > p.conf.Active - p.mu.Unlock() if syncIdle { p.setIdle(n) }