containerd/remotes/docker
Wei Fu 80dd779deb remotes/docker: close connection if no more data
Close connection if no more data. It's to fix false alert filed by image
pull progress.

```
dst = OpenWriter (--> Content Store)

src = Fetch
        Open (--> Registry)
        Mark it as active request

Copy(dst, src) (--> Keep updating total received bytes)

   ^
   |  (Active Request > 0, but total received bytes won't be updated)
   v

defer src.Close()
content.Commit(dst)
```

Before migrating to transfer service, CRI plugin doesn't limit global
concurrent downloads for ImagePulls. Each ImagePull requests have 3 concurrent
goroutines to download blob and 1 goroutine to unpack blob. Like ext4
filesystem [1][1], the fsync from content.Commit may sync unrelated dirty pages
into disk. The host is running under IO pressure, and then the content.Commit
will take long time and block other goroutines. If httpreadseeker
doesn't close the connection after io.EOF, this connection will be
considered as active. The pull progress reporter reports there is no
bytes transfered and cancels the ImagePull.

The original 1-minute timeout[2][2] is from kubelet settting. Since CRI-plugin
can't limit the total concurrent downloads, this patch is to update 1-minute
to 5-minutes to prevent from unexpected cancel.

[1]: https://lwn.net/Articles/842385/
[2]: https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/kubelet/config/flags.go#L45-L48

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-11-18 10:23:05 +08:00
..
auth Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
config Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
schema1 Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
authorizer.go Merge pull request #9306 from dmcgowan/containerd-v2-module 2023-11-01 15:20:35 +00:00
converter_fuzz.go Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
converter.go Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
errcode.go docs: Various typo found by codespell 2020-12-22 13:22:16 +08:00
errdesc.go Add distribution subpkgs to core 2019-10-07 13:38:12 -04:00
fetcher_fuzz.go replace reference/docker for github.com/distribution/reference v0.5.0 2023-08-31 15:54:50 +02:00
fetcher_test.go removes/docker: replace some fmt.Sprintfs with strconv 2023-08-23 10:10:59 +02:00
fetcher.go Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
handler_test.go Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
handler.go Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
httpreadseeker.go remotes/docker: close connection if no more data 2023-11-18 10:23:05 +08:00
pusher_test.go Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
pusher.go Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
registry_test.go Use net.IP.IsLoopback() to match loopback addresses 2021-03-15 09:57:01 +05:30
registry.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
resolver_test.go Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
resolver.go Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
scope_test.go Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
scope.go Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00
status.go Update go module to github.com/containerd/containerd/v2 2023-10-29 20:52:21 -07:00