Bitswap should use one stream per message
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- go
调研方向
未指定源文件、测试或入口点。首先跟踪 Bitswap 消息和流的生命周期代码,然后查看 issue 中描述的 Yamux 缓冲上下文。完成的要求是:就每条消息使用独立流、peer 断开时的清理,以及对由此产生的行为进行覆盖测试,达成一致的方案。
由索引模型根据 Issue 内容生成。
描述
We should consider changing bitswap to use one stream per message.
@MarcoPolo:
Ideally we'd use one stream per message and close the stream once we're done. I believe the reason we don't do that is that in Yamux the initial send buffer is constant per stream (rather than configurable both within a stream and per connection connection as in QUIC). This means that if our initial message is larger than that initial send capacity, then we have to wait for a round trip to send the whole message. By reusing the stream, the peer can increase our send buffer size in a later message.
It may be worth changing this in Yamux.
The real issue is that the cleanup of peer disconnects is slow. A lot of time is spent on acquiring the lock by many different goroutines.
The benefit of the one stream per message approach is that you avoid the whole issue of maintaining a reference and knowing if a connection is even alive or not.
@gammazero:
Seems worth it to having one stream per message. Reusing the stream is like double-muxing to avoid a buffer sizing issue. Being able to have different messages on the same connection is the point of muxing, and streams is the mechanism for doing that.
The initial yamux stream buffer size is 256Kib. If most of our messages are smaller, then no change to yamux is needed. I suspect we do need a larger buffer, particularly for block transfer. Seems like a change to yamux is worth it, unless the occasional extra round trip is not a significant problem.
- 主要语言
- Go
- 星标
- 326
- 派生
- 165
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ipfs/boxo 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 4/5 3-5 天 新手友好度 46/100
-
难度 3/5 1-2 天 新手友好度 55/100
-
need/triage
难度 5/5 一周以上 新手友好度 38/100
-
dif/medium effort/hours kind/enhancement P3 topic/devexp
难度 5/5 一周以上 新手友好度 35/100
相似的 Issue
-
area/networking kind/bug
难度 2/5 1-3 小时 新手友好度 69/100
siderolabs/talos#14972 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
kubectl wait outputs cryptic "error: unrecognized condition: []" when --for is omitted可能已有人在做 @muskan-creates352 今天认领。 未关闭kind/bug needs-triage
难度 2/5 1-3 小时 新手友好度 84/100
kubernetes/kubectl#1910 · 1 条评论 ·
-
needs-triage
难度 2/5 1-3 小时 新手友好度 66/100
stacklok/toolhive-catalog#1967 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
unbound-force/gaze#353 ·
维护者通常 1 天内回复