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

DM-48838: Create Gafaelfawr tokens in parallel #403

Merged
merged 1 commit into from
Feb 13, 2025
Merged

Conversation

rra
Copy link
Member

@rra rra commented Feb 8, 2025

When creating a flock, create the Gafaelfawr tokens in parallel (up to the limit of the httpx connection pool, which is 100) instead of serially.

No business is using the shared global httpx client and connection pool, so remove it from the constructors of all of the business classes and stop passing it down. The Nublado business uses a separate connection pool per monkey maintained in the Nublado client, and the TAP business uses pyvo, which manages its own connections.

When creating a flock, create the Gafaelfawr tokens in parallel
(up to the limit of the httpx connection pool, which is 100) instead
of serially.

No business is using the shared global httpx client and connection
pool, so remove it from the constructors of all of the business
classes and stop passing it down. The Nublado business uses a
separate connection pool per monkey maintained in the Nublado client,
and the TAP business uses pyvo, which manages its own connections.
@rra rra requested a review from fajpunk February 8, 2025 00:47
Copy link
Member

@fajpunk fajpunk left a comment

Choose a reason for hiding this comment

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

Do we also want to add a parameter to the Safir http client to control the connection pool size?

@rra
Copy link
Member Author

rra commented Feb 13, 2025

That is kind of annoying to do because of how the dependency is set up. I think it makes sense to hold off for now and see if we need this elsewhere. So far, the two places I've needed to make this change didn't really use the dependency as a dependency (something used during the processing of one request to a route handler) and kept global state anyway, so it was easy to just create a pool.

@rra rra merged commit 10cc31e into main Feb 13, 2025
4 checks passed
@rra rra deleted the tickets/DM-48838 branch February 13, 2025 19:02
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