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

linkcheck builder: begin using session-based HTTP requests #11503

Merged

Conversation

jayaddison
Copy link
Contributor

Feature or Bugfix

  • Bugfix
  • Refactoring

Purpose

  • Reduce the number of HTTP connections used during linkchecking, reducing network resource usage.

Detail

Relates

sphinx/util/requests.py Outdated Show resolved Hide resolved
@AA-Turner
Copy link
Member

Should we rewrite the existing get and head in terms of a session? This is how requests implements its module-level request methods, might make sense to take inspiration from that.

A

@jayaddison
Copy link
Contributor Author

It's probably a good idea to re-use the same code paths for both methods.. my rationale when duplicating the implementations was to avoid modifying any non-linkcheck-builder code.

I'll take another look into consolidating them into shared implementations.

@jayaddison
Copy link
Contributor Author

What do you think of the approach in b7d7fcf ?

@AA-Turner
Copy link
Member

I've pushed a commit to only implement the lower-level Session.request, to avoid duplication -- hopefully all looks good!

A

@jayaddison
Copy link
Contributor Author

I've pushed a commit to only implement the lower-level Session.request, to avoid duplication -- hopefully all looks good!

Nice - yep, that looks much better to me 👍

@AA-Turner AA-Turner merged commit 450ad63 into sphinx-doc:master Jul 23, 2023
27 checks passed
@AA-Turner
Copy link
Member

Thanks @jayaddison -- this is the culmination of quite a bit of preparatory work, thank you for driving this all through!

A

@jayaddison
Copy link
Contributor Author

Thank you very much @AA-Turner :)

You're welcome. I'll follow along with the next release to listen for user feedback.

@jayaddison jayaddison deleted the issue-11324/linkcheck-sessioned-requests branch July 23, 2023 21:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

linkcheck builder: begin using requests.Session functionality during linkchecking
2 participants