-
Notifications
You must be signed in to change notification settings - Fork 288
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
if curl fails, print a warning instead of exiting #1137
if curl fails, print a warning instead of exiting #1137
Conversation
I will add test about |
I agree with your analysis on the impact of this for binary caching, but I do not agree with the solution you've chosen here. Just because today Your bug report is that curl returned a valid exit code indicating a connection error, and we are interpreting that as 'curl crashed'. I agree that response is overblown, but treating real crashes as nothing isn't great either. Perhaps having an allow list of known curl exit codes that indicate transient network issues should go into the 'retry' bucket? |
@BillyONeal I thought that the program termination should be determined by the caller, not the I will modify the code as you suggested: If three retries are attempted due to an exit code from the allowed list, and all of them fail, warning message is printed and response code of value 0 will returned (as in the current PR implementation). Do you have any opinions or suggestions regarding this? |
Yes, I agree. I'm saying the interface needs to be changed to expose this error, not just eat the error while printing a warning.
I think it needs to be exposed to the caller somehow so it can emit a reasonable message. Perhaps by returning |
The |
673dd2f failed the test since GitHub actions runner for ubuntu 20.04 has a lower version of curl (< 7.75.0, which does not support the I changed to determine errors based on HTTP response codes instead of the exit code. Also, considering the use of a lower version of curl, I assigned the command's exit code for the last error. |
With In general I would vote for an option like |
I think the upload code has the same problem (exit code != 0 => exit vcpkg) |
Any progress of this PR? |
As written it breaks Ubuntu 20.04 customers so I don't think we could accept it in that condition |
My last comment means that I modified it by changing the way errors are determined (in 4daad5e) because my previous modifications failed in Ubuntu 20.04 (in commit 673dd2f). |
Sorry I broke the merge somehow, will fix... |
c022a1e
to
4daad5e
Compare
Currently, the `download_files` function is only used by binary caching providers (`HttpGetBinaryProvider` and `GHABinaryProvider`), so I think it is okay to change the function so that it does not exit with error. I manually tested following scenarios: | **--only-binarycaching** | **server up** | **server down** | | ------------------------ | ------------- | ------------------ | | **Without** | OK | Continue with Warn | | **With** | OK | Exit with Error | * Move retries for curl operations into curl itself. * Added function to parse curl status lines with error messages embedded and tests. * Add getting exit code and error message for each curl operation, and return those operation results through ExpectedL<int> rather than terminating vcpkg. * Add test case handling for old curl tested on Ubuntu 20.04.
4daad5e
to
15b9a99
Compare
I was unable to get the merge to show up cleanly in GitHub, so I put everything into a squash commit. The SHA before I did this was 4daad5e I also rewrote the status line parsing bit to avoid adding a dependency on iostreams. |
Fix microsoft/vcpkg#32522
Currently, the
download_files
function is only used by binary caching providers (HttpGetBinaryProvider
andGHABinaryProvider
), so I think it is okay to change the function so that it does not exit with error.I manually tested following scenarios:
I couldn't find the relevant test code. If you let me know, I'll willing to write it.