mirror of
https://github.com/moby/moby.git
synced 2025-07-30 18:23:29 +03:00
Improved push and pull with upload manager and download manager
This commit adds a transfer manager which deduplicates and schedules transfers, and also an upload manager and download manager that build on top of the transfer manager to provide high-level interfaces for uploads and downloads. The push and pull code is modified to use these building blocks. Some benefits of the changes: - Simplification of push/pull code - Pushes can upload layers concurrently - Failed downloads and uploads are retried after backoff delays - Cancellation is supported, but individual transfers will only be cancelled if all pushes or pulls using them are cancelled. - The distribution code is decoupled from Docker Engine packages and API conventions (i.e. streamformatter), which will make it easier to split out. This commit also includes unit tests for the new distribution/xfer package. The tests cover 87.8% of the statements in the package. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
@ -140,7 +140,7 @@ func (s *DockerHubPullSuite) TestPullAllTagsFromCentralRegistry(c *check.C) {
|
||||
}
|
||||
|
||||
// TestPullClientDisconnect kills the client during a pull operation and verifies that the operation
|
||||
// still succesfully completes on the daemon side.
|
||||
// gets cancelled.
|
||||
//
|
||||
// Ref: docker/docker#15589
|
||||
func (s *DockerHubPullSuite) TestPullClientDisconnect(c *check.C) {
|
||||
@ -161,14 +161,8 @@ func (s *DockerHubPullSuite) TestPullClientDisconnect(c *check.C) {
|
||||
err = pullCmd.Process.Kill()
|
||||
c.Assert(err, checker.IsNil)
|
||||
|
||||
maxAttempts := 20
|
||||
for i := 0; ; i++ {
|
||||
if _, err := s.CmdWithError("inspect", repoName); err == nil {
|
||||
break
|
||||
}
|
||||
if i >= maxAttempts {
|
||||
c.Fatal("timeout reached: image was not pulled after client disconnected")
|
||||
}
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
time.Sleep(2 * time.Second)
|
||||
if _, err := s.CmdWithError("inspect", repoName); err == nil {
|
||||
c.Fatal("image was pulled after client disconnected")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user