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

copy context before starting stash operations to prevent ctx cancellations #1790

Merged
merged 2 commits into from
Sep 15, 2022

Conversation

r-ashish
Copy link
Member

@r-ashish r-ashish commented Sep 15, 2022

What is the problem I am trying to address?

We started receiving some RequestCanceled: request context canceled errors after setting the download mode to async_redirect (same problem happens with async as well).

After some investigation we found that the same context from the HTTP handler is being passed to stasher and the async routines fail to continue after the request is complete since the context gets cancelled after completion.

This PR creates a new context with custom timeout and copies over some values from the old context to solve this issue.

@r-ashish r-ashish requested a review from a team as a code owner September 15, 2022 10:13
@r-ashish
Copy link
Member Author

r-ashish commented Sep 15, 2022

Also, I came across another PR trying to fix the same issue: #1765 but I'm not seeing any activity on it so I decided to create a new PR since this has been bothering us as well. For now we've set the mode to sync.

I've tried to incorporate the suggestions from the comments on the other PR as well. Do let me know if I missed anything.

@r-ashish r-ashish changed the title [WIP] copy context before starting stash operations to prevent ctx cancellations copy context before starting stash operations to prevent ctx cancellations Sep 15, 2022
Copy link
Contributor

@marwan-at-work marwan-at-work 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 for the fix 🎉

@marwan-at-work marwan-at-work merged commit 33777c5 into gomods:main Sep 15, 2022
@issenn
Copy link

issenn commented Jan 20, 2023

here, The problem still exists

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.

3 participants