ConfigureConnectionLanes: reconfiguring lanes can leave one lane in a stale priority class
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- cpp
- 领域
- networking
调研方向
Read CSteamNetworkConnectionBase::SNP_ConfigureLanes in steamnetworkingsockets_snp.cpp, focusing on the loop that merges sorted priority classes and assigns m_idxPriorityClass. Reproduce by swapping lane priorities, then check lane status; also try priorities {0, 1, 2} followed by {1, 1, 0} to expose the out-of-bounds case. Done means every lane's class matches the current priorities after each configuration; linked PR #454 is already open.
由索引模型根据 Issue 内容生成。
描述
What happens
The docs for ConfigureConnectionLanes say lanes may be reconfigured at any time. When a connection reconfigures its lanes, the lane with the lowest priority value (the one that sorts first) keeps whatever m_idxPriorityClass it had from the previous configuration. Every other lane gets its class index reassigned.
Swapping priorities on two lanes is enough to see it. Lane 1 should now be strictly ahead of lane 0, but it stays in class 1 next to lane 0. Class 0 ends up with no lanes, and the two lanes share bandwidth by weight instead of by priority.
If the stale index is greater than or equal to the new number of priority classes, m_vecPriorityClasses[ l.m_idxPriorityClass ] in the "Setup each lane" loop reads past the end of the vector. For example: priorities { 0, 1, 2 }, then { 1, 1, 0 }. Lane 2 keeps class 2, but there are now only 2 classes.
What should happen
After every call, each lane's priority class should match the priorities passed to that call.
Minimal repro
// hSender from CreateSocketPair( ..., true, ... ), fixed send rate of 128 KB/s
int prio1[2] = { 0, 1 };
ConfigureConnectionLanes( hSender, 2, prio1, nullptr );
int prio2[2] = { 1, 0 };
ConfigureConnectionLanes( hSender, 2, prio2, nullptr );
// queue 64 KB of unreliable messages on each lane, then:
GetConnectionRealTimeStatus( hSender, &status, 2, laneStatus );
Expected: lane 1 queue time is about 500 ms and lane 0 is about 1000 ms.
Actual: both lanes report 1000 ms, because they are scheduled in the same class.
Root cause
In CSteamNetworkConnectionBase::SNP_ConfigureLanes (steamnetworkingsockets_snp.cpp), the loop that merges sorted priority classes starts at j = 1 and only assigns m_idxPriorityClass for pPriorityClass[j]. The entry at sorted position 0 is never assigned. On the first configuration this goes unnoticed, because a newly created lane defaults to class 0. On a later reconfiguration, that lane may already exist with a nonzero class.
- 主要语言
- C++
- 星标
- 10k
- 派生
- 767
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ValveSoftware/GameNetworkingSockets 的其他 Issue
-
ICE (native client): relay-only connections time out against a real TURN server; host-socket checks starve the relay pairs可能已有人在做 @Mr444-dev 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 79/100
ValveSoftware/GameNetworkingSockets#452 ·
维护者通常 2 天内回复
-
难度 4/5 一周以上 新手友好度 12/100
ValveSoftware/GameNetworkingSockets#465 ·
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 18/100
ValveSoftware/GameNetworkingSockets#464 ·
维护者通常 2 天内回复
-
Assertion Failed: pSock->m_callback.m_fnCallback (socketthread.cpp:2609) after re-initializing the library with GameNetworkingSockets_Kill + GameNetworkingSockets_Init可能已有人在做 @siddiqueirshad 于 10 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
ValveSoftware/GameNetworkingSockets#458 ·
维护者通常 2 天内回复
-
ISteamNetworkingSockets: Trying to use over 8 network lanes/channels fails可能已有人在做 @jpggvilaca 于 14 天前认领。 未关闭
难度 4/5 1-2 天 新手友好度 55/100
ValveSoftware/GameNetworkingSockets#455 ·
维护者通常 2 天内回复
查看 ValveSoftware/GameNetworkingSockets 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
Sunrisepeak/mcpp-language-server#80 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
xiaoyifang/goldendict-ng#3148 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 91/100
triton-inference-server/server#9069 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 4 天内回复