Skip to content

refactor: Replace connection pool #138

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

Merged
merged 5 commits into from
Aug 22, 2025
Merged

refactor: Replace connection pool #138

merged 5 commits into from
Aug 22, 2025

Conversation

rklaehn
Copy link
Collaborator

@rklaehn rklaehn commented Aug 21, 2025

Description

Replaces the somewhat hackish connection pool with the one from n0-computer/iroh-experiments#36 that was battle tested more.

Breaking Changes

None

Notes & open questions

Q: Expose the conn pool here?

Note: There is a nice list of possible extensions, but I think it is probably best to first get the basic version in.

Extensions would be async fn ban(node_id: NodeId, duration: Option<Duration>), bans the node for a time, or for as long as the conn pool lives if duration is set to None.

A way to observe pool stats so users know when to schedule new downloads without having to try.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

Copy link

github-actions bot commented Aug 21, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh-blobs/pr/138/docs/iroh_blobs/

Last updated: 2025-08-22T07:22:44Z

@n0bot n0bot bot added this to iroh Aug 21, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Aug 21, 2025
@rklaehn rklaehn requested a review from matheus23 August 21, 2025 10:55
Copy link
Member

@matheus23 matheus23 left a comment

Choose a reason for hiding this comment

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

I should've read this before reading the iroh-experiments code 🙃

Makes sense that we need a connection pool when we have multiprovider blob imports. You don't ask for a blob from a specific node after all 🙃

We need to pool connections for all kinds of reasons I guess. Sometimes it's performance and socket limitations as in HTTP2, sometimes it's because it's an abstraction boundary. Might be interesting to look into how browsers deal with HTTP3. How long do they keep the connection open, in case some JS decides to do further requests to the server? Anyhow.

LGTM, besides small nits.

…e can

make util public.

The ConnPool will probably move somewhere else in the longer term.
@@ -714,6 +718,73 @@ impl TryFrom<VarInt> for Closed {
}
}

pub trait ChunkRangesExt {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess this thing should move to bao-tree at some point!

@rklaehn rklaehn merged commit f5b5ab4 into main Aug 22, 2025
24 checks passed
@rklaehn rklaehn deleted the replace-connection-pool branch August 22, 2025 07:58
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in iroh Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants