Skip to content

Commit 59defcb

Browse files
author
Ian Campbell
committed
add a 10s timeout to the client object.
This partially mitigates docker#1739 ("Docker commands take 1 minute to timeout if context endpoint is unreachable") and is a simpler alternative to docker#1747 (which completely defers the client connection until an actual call is attempted). Note that the previous 60s delay was the culmination of two separate 30s timeouts since the ping is tried twice. This with this patch the overall timeout is 20s. moby/moby#39206 will remove the second ping and once that propagates to this tree the timeout will be 10s. Signed-off-by: Ian Campbell <ijc@docker.com>
1 parent 53fc257 commit 59defcb

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

cli/context/docker/load.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ func (c *Endpoint) ClientOpts() ([]client.Opt, error) {
122122
client.WithDialContext(helper.Dialer),
123123
)
124124
}
125+
result = append(result, client.WithTimeout(10*time.Second))
125126
}
126127

127128
version := os.Getenv("DOCKER_API_VERSION")

0 commit comments

Comments
 (0)