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

Pass context to httpGet #2

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Pass context to httpGet #2

merged 1 commit into from
Jun 25, 2024

Conversation

hryx
Copy link
Contributor

@hryx hryx commented Jun 25, 2024

This fixes a bug where the context is getting canceled immediately after making a request, due to defering the cancel() within a helper function. The symptom was that all cached files are truncated to a few KB.

Mirrors should delete truncated cached files after upgrading wrench.

As a follow up, we should also write the response to a temporary file and atomically swap it with the destination afterward. Even with this fix, it is possible to cache a truncated file at a served path when the connection to ziglang.org is dropped.

  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.

This should fix a bug where the context is getting canceled immediately
because of the defered `cancel()` within the helper function.
@emidoots emidoots merged commit 42798b6 into hexops:main Jun 25, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants