moby/graph
Josh Hawn 74df05ccaa [graph] Use a pipe for downloads to write progress
The process of pulling an image spawns a new goroutine for each layer in the
image manifest. If any of these downloads fail we would stop everything and
return the error, even though other goroutines would still be running and
writing output through a progress reader which is attached to an http response
writer. Since the request handler had already returned from the first error,
the http server panics when one of these download goroutines makes a write to
the response writer buffer.

This patch prevents this crash in the daemon http server by waiting for all of
the download goroutines to complete, even if one of them fails. Only then does
it return, terminating the request handler.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)

(cherry picked from commit d80c4244d3)
2015-08-06 09:14:16 -07:00
..
tags Check if a tag name to load is a valid digest. 2015-07-16 10:53:56 -07:00
export.go Windows: graph\export.go filepath fixes 2015-05-04 14:56:23 -07:00
graph.go graph: isolate the (dis)assembly logic 2015-07-22 11:36:15 -04:00
graph_test.go Fixing Image struct to no longer use Graph. 2015-07-20 13:59:53 -07:00
graph_unix.go graph: isolate the (dis)assembly logic 2015-07-22 11:36:15 -04:00
graph_windows.go graph: isolate the (dis)assembly logic 2015-07-22 11:36:15 -04:00
history.go Fixing Image struct to no longer use Graph. 2015-07-20 13:59:53 -07:00
import.go Refactor pkg/stremformatter with custom constructors instead of passing a boolean 2015-05-13 00:09:41 +02:00
list.go Fixing Image struct to no longer use Graph. 2015-07-20 13:59:53 -07:00
load.go Fixing Image struct to no longer use Graph. 2015-07-20 13:59:53 -07:00
load_unsupported.go Windows: Build load.go 2015-05-12 14:26:57 -07:00
mutex.go Attempt to protect on disk image store with mutex 2015-06-25 20:16:37 -07:00
pools_test.go don't call reexec.Init from chrootarchive 2014-11-25 01:03:40 +02:00
pull.go Update graph to use vendored distribution client for the v2 codepath 2015-07-16 13:13:47 -04:00
pull_v1.go Improve documentation and golint compliance of registry package 2015-07-24 11:55:07 -07:00
pull_v2.go [graph] Use a pipe for downloads to write progress 2015-08-06 09:14:16 -07:00
push.go Avoid redundant HEAD requests for identical layers on push 2015-07-22 17:54:20 -07:00
push_v1.go Improve documentation and golint compliance of registry package 2015-07-24 11:55:07 -07:00
push_v2.go Use notary library for trusted image fetch and signing 2015-07-24 14:08:20 -07:00
registry.go Use notary library for trusted image fetch and signing 2015-07-24 14:08:20 -07:00
service.go Format times in inspect command with a template as RFC3339Nano 2015-07-28 09:35:14 -07:00
tags.go Fixing Image struct to no longer use Graph. 2015-07-20 13:59:53 -07:00
tags_unit_test.go Fixing Image struct to no longer use Graph. 2015-07-20 13:59:53 -07:00