From 26f2e002c6142061f38f44980f2c1e9dd3d0bdc5 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 17 Apr 2025 14:26:25 +0200 Subject: [PATCH] vendor: github.com/moby/spdystream v0.5.0 (indirect) This is an indirect dependency, but I recalled it fixed some leaking goroutines, so it may be worth considering updating. full diff: https://github.com/moby/spdystream/compare/v0.4.0...v0.5.0 Signed-off-by: Sebastiaan van Stijn --- go.mod | 2 +- go.sum | 4 ++-- .../github.com/moby/spdystream/connection.go | 18 +++++++++++++++--- vendor/modules.txt | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 9413c0da..00f7595e 100644 --- a/go.mod +++ b/go.mod @@ -132,7 +132,7 @@ require ( github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/locker v1.0.1 // indirect github.com/moby/patternmatcher v0.6.0 // indirect - github.com/moby/spdystream v0.4.0 // indirect + github.com/moby/spdystream v0.5.0 // indirect github.com/moby/sys/sequential v0.6.0 // indirect github.com/moby/sys/user v0.4.0 // indirect github.com/moby/sys/userns v0.1.0 // indirect diff --git a/go.sum b/go.sum index c4514757..5d5034a6 100644 --- a/go.sum +++ b/go.sum @@ -289,8 +289,8 @@ github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= -github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8= -github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= +github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU= +github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs= github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg= diff --git a/vendor/github.com/moby/spdystream/connection.go b/vendor/github.com/moby/spdystream/connection.go index d649eccc..1394d0ad 100644 --- a/vendor/github.com/moby/spdystream/connection.go +++ b/vendor/github.com/moby/spdystream/connection.go @@ -712,7 +712,9 @@ func (s *Connection) shutdown(closeTimeout time.Duration) { var timeout <-chan time.Time if closeTimeout > time.Duration(0) { - timeout = time.After(closeTimeout) + timer := time.NewTimer(closeTimeout) + defer timer.Stop() + timeout = timer.C } streamsClosed := make(chan bool) @@ -739,7 +741,15 @@ func (s *Connection) shutdown(closeTimeout time.Duration) { } if err != nil { - duration := 10 * time.Minute + // default to 1 second + duration := time.Second + // if a closeTimeout was given, use that, clipped to 1s-10m + if closeTimeout > time.Second { + duration = closeTimeout + } + if duration > 10*time.Minute { + duration = 10 * time.Minute + } timer := time.NewTimer(duration) defer timer.Stop() select { @@ -806,7 +816,9 @@ func (s *Connection) CloseWait() error { func (s *Connection) Wait(waitTimeout time.Duration) error { var timeout <-chan time.Time if waitTimeout > time.Duration(0) { - timeout = time.After(waitTimeout) + timer := time.NewTimer(waitTimeout) + defer timer.Stop() + timeout = timer.C } select { diff --git a/vendor/modules.txt b/vendor/modules.txt index 66849124..9e9b190b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -578,7 +578,7 @@ github.com/moby/locker ## explicit; go 1.19 github.com/moby/patternmatcher github.com/moby/patternmatcher/ignorefile -# github.com/moby/spdystream v0.4.0 +# github.com/moby/spdystream v0.5.0 ## explicit; go 1.13 github.com/moby/spdystream github.com/moby/spdystream/spdy