Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: change download timeout to 5 minutes instead of 20s, fixes #7298#7300

Merged
rfay merged 2 commits intoddev:mainfrom
rfay:20250515_rfay_longer_timeout
May 16, 2025
Merged

fix: change download timeout to 5 minutes instead of 20s, fixes #7298#7300
rfay merged 2 commits intoddev:mainfrom
rfay:20250515_rfay_longer_timeout

Conversation

@rfay
Copy link
Member

@rfay rfay commented May 15, 2025

The Issue

On slower networks, the download of docker-compose times out in just 20s and gives an odd message

How This PR Solves The Issue

  • Increase the timeout
  • Improve the message given on failure

Manual Testing Instructions

I used network conditioning in Parallels to slow the download speed to 20Mbps to reproduce this.

Running TestDockerComposeDownload with the network slowed down shows the failure at 20s, but it succeed with this fix.

Automated Testing Overview

Release/Deployment Notes

@github-actions
Copy link

github-actions bot commented May 15, 2025

@rfay
Copy link
Member Author

rfay commented May 15, 2025

New message example:

Network ddev_default created 
docker-compose 38.58 MiB / 68.63 MiB [================>------------]  56.22% 19s
Failed to download updated docker-compose binary.
This might be due to network issues or a slow response. 
Please ensure your network is stable and try again:
context deadline exceeded (Client.Timeout or context cancellation while reading body) 

@rfay rfay marked this pull request as ready for review May 15, 2025 19:03
@rfay rfay requested a review from a team as a code owner May 15, 2025 19:03
@rfay rfay requested a review from stasadev May 15, 2025 19:03
Copy link
Member

@stasadev stasadev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, looks good to me!

client.Backoff = retryablehttp.DefaultBackoff
client.Logger = nil
client.HTTPClient.Timeout = 20 * time.Second
client.HTTPClient.Timeout = 5 * time.Minute
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change only for downloading images on upgrade? If not, what other scenarios use this timeout?

Copy link
Member Author

@rfay rfay May 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has nothing to do with docker images, only things that use DownloadFile(), which means docker-compose, mutagen, and ddev add-on get downloads at this point.

@rfay rfay merged commit 660bdae into ddev:main May 16, 2025
26 checks passed
@rfay rfay deleted the 20250515_rfay_longer_timeout branch May 16, 2025 15:35
@rfay
Copy link
Member Author

rfay commented May 16, 2025

OK, going with it. Having this in HEAD may make it easier for some people to test/use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments