moby/vendor/resenje.org/singleflight
Paweł Gronowski dec81e489f
daemon/disk_usage: Use context aware singleflight
The singleflight function was capturing the context.Context of the first
caller that invoked the `singleflight.Do`. This could cause all
concurrent calls to be cancelled when the first request is cancelled.

singleflight calls were also moved from the ImageService to Daemon, to
avoid having to implement this logic in both graphdriver and containerd
based image services.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2022-11-29 16:46:19 +01:00
..
LICENSE daemon/disk_usage: Use context aware singleflight 2022-11-29 16:46:19 +01:00
README.md daemon/disk_usage: Use context aware singleflight 2022-11-29 16:46:19 +01:00
singleflight.go daemon/disk_usage: Use context aware singleflight 2022-11-29 16:46:19 +01:00

Singleflight

GoDoc Go

Package singleflight provides a duplicate function call suppression mechanism similar to golang.org/x/sync/singleflight but with support for context cancelation.

Installation

Run go get resenje.org/singleflight from command line.