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

Downloader support resume from connection reset #9422

Merged
merged 11 commits into from
Aug 17, 2024

Conversation

austinzh
Copy link
Contributor

@austinzh austinzh commented May 17, 2024

Pull Request Check List

Resolves: #3219
Resolves: #9551

  • Added tests for changed code.
  • Updated documentation for changed code.

Copy link
Member

@radoering radoering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

download_file() is used in some more places (HTTPRepository, DirectOrigin), which might not be relevant for installing but only for locking. Maybe, connection resets are not that relevant for locking. On the other side, it feels more consistent to also retry in this case. What do you think?

HTTPRepository already has the config available, so it is easy to use the setting. For DirectOrigin, we had to add another parameter.

src/poetry/config/config.py Outdated Show resolved Hide resolved

**Environment Variable**: `POETRY_INSTALLER_MAX_RETRIES`

*Introduced in 1.9.0*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to myself: The next version might be 2.0.0.

docs/configuration.md Outdated Show resolved Hide resolved
@austinzh
Copy link
Contributor Author

austinzh commented Jun 12, 2024

download_file() is used in some more places (HTTPRepository, DirectOrigin), which might not be relevant for installing but only for locking. Maybe, connection resets are not that relevant for locking. On the other side, it feels more consistent to also retry in this case. What do you think?

HTTPRepository already has the config available, so it is easy to use the setting. For DirectOrigin, we had to add another parameter.

Sure. I can add parameter to them, It's my first time working in this repo, I agree that even they are not much needed for retry it's better to make it all consistent.

But for the config, should we still use installer.max-retries? I think it's still valid name right? Or we add solver.max-retries ?
@radoering

@radoering
Copy link
Member

But for the config, should we still use installer.max-retries? I think it's still valid name right? Or we add solver.max-retries ?

Good question. Thinking about it, installer.max-retries might have been a bit ambiguous from the start: We only retry the download not the complete installation. I think we should introduce a new section, maybe call it network or requests? (We already have a POETRY_REQUESTS_TIMEOUT, which is not yet available via config but only via environment variable; anyway, I think that one would fit into the same section.)

@austinzh austinzh requested a review from radoering June 24, 2024 04:06
Copy link
Contributor Author

@austinzh austinzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change config to "requests.max-retries"

src/poetry/config/config.py Outdated Show resolved Hide resolved
@SmartManoj
Copy link

Please reopen #3219 to close the duplicate of #9551

@radoering
Copy link
Member

Please reopen #3219 to close the duplicate of #9551

I do not think reopening #3219 makes sense because it is was closed a long time ago. Generally, we do not need an issue if we already have a PR. However, since some users only search issues, I think it is ok to keep #9551 open until this one is merged.

@SmartManoj
Copy link

Does this PR need any change?

@radoering
Copy link
Member

Does this PR need any change?

I think all my comments have been addressed but I still have to review the changes. I won't have time for the next two weeks but feel free to remind me end of August if I have not come back to this issue by then.

@radoering radoering added the impact/docs Contains or requires documentation changes label Aug 17, 2024
Copy link

Deploy preview for website ready!

✅ Preview
https://website-8c1zr2f5e-python-poetry.vercel.app

Built with commit f8db472.
This pull request is being automatically deployed with vercel-action

@radoering radoering merged commit fe3641e into python-poetry:main Aug 17, 2024
78 checks passed
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
impact/docs Contains or requires documentation changes
Projects
None yet
3 participants