Fix CURL filesystem deadlock with corporate proxy#16499
Fix CURL filesystem deadlock with corporate proxy#16499SoftwareApe wants to merge 1 commit intomicrosoft:masterfrom
Conversation
The CURL call to the metrics endpoint doesn't have a timeout. When executing this behind a corporate proxy that blocks this access the filesystem is in a deadlock until curl is killed. By adding a 200ms timeout we give ample time for CURL to finish its request, while also not stopping usage inside local network.
|
Thanks for the PR! Additionally, we should explicitly release the filesystem lock before spawning the subprocess since there's no need to block another vcpkg invocation in that case. This would enable us to increase the timeout to 3-5 seconds, which should work better on slower connections. Could you make this PR against the new source location: https://github.com/Microsoft/vcpkg-tool ? |
|
@ras0219 thank you for the quick response. Yes higher timeout may be better if the lock can be released separately. I didn't take too much time to go through the codebase, just grepped for curl. 🙂 |
|
@SoftwareApe Please make a same PR to https://github.com/microsoft/vcpkg-tool/pulls. |
|
@JackBoosY I created microsoft/vcpkg-tool#22 as requested. I didn't look for how to release the filesystem lock earlier. I also increased the timeout 3s as discussed. |
The CURL call to the metrics endpoint doesn't have a timeout. When executing this behind a corporate proxy that blocks this access the filesystem is in a deadlock until curl is killed. By adding a 200ms timeout we give ample time for CURL to finish its request, while also not stopping usage inside local network.
Describe the pull request
What does your PR fix? Fixes Failed to take the filesystem lock on /home/USER/vcpkg/.vcpkg-root, need to pkill curl to unlock #16476
Which triplets are supported/not supported? Have you updated the CI baseline? Affects non-Windows users. No update to CI baseline.
Does your PR follow the maintainer guide? AFAIK, yes, but please edit the PR as necessary if there's something that doesn't conform to your guidelines.