Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg] Add timeout to curl download from FTP and HTTP #1552

Closed
wants to merge 1 commit into from

Conversation

FrankXie05
Copy link
Contributor

Fix microsoft/vcpkg#42394

The put_file function lacked timeout parameters for curl commands, leading to potential hangs if the server was unresponsive. This update improves the robustness by adding --max-time and --connect-timeout.

Added --max-time (60 seconds) and --connect-timeout (10 seconds) to curl commands.
Used constants for timeout values for maintainability.

@FrankXie05
Copy link
Contributor Author

@BillyONeal

@BillyONeal
Copy link
Member

If curl does not do this out of the box it's unclear that vcpkg choosing different values is correct....

@FrankXie05
Copy link
Contributor Author

In fact, I don't have a specific example locally to prove whether our curl has a default timeout. I just saw the error log of the user's issue showing that we don't have a mechanism to trigger the timeout.

I think we can make a public option VCPKG_CURL_TIMEOUT to facilitate users to use in this case.

@JavierMatosD JavierMatosD added requires:vcpkg-team-review This PR or issue requires someone from the vcpkg team to take a further look. requires:discussion This PR requires discussion of the correct way forward and removed requires:vcpkg-team-review This PR or issue requires someone from the vcpkg team to take a further look. labels Dec 13, 2024
@JavierMatosD
Copy link
Contributor

Hi @FrankXie05, Thank you for your contribution! I brought this up to the team today. (@ras0219-msft, @BillyONeal, @AugP, @vicroms)

We do not believe it is appropriate to hardcode a timeout. Since this is affecting put_file, a potential workaround could be adding a curl.bat wrapper, adding the timeouts, to your PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires:discussion This PR requires discussion of the correct way forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VCPKG may freeze due to no timeout for curl calls
3 participants