Merged
Conversation
【懸念事項】 完了条件の「mediasoup再現シナリオで Jest open handle 警告解消」はこのブランチ内で実証されておらず、追加テストも fake timers+privateメソッド直接呼び出し中心で実ハンドル検出(`--detectOpenHandles` 相当)を直接担保していません。 【改善提案】 - mediasoup の `test-werift-sctp.ts` 相当シナリオを real timer で実行する統合テストを追加 - 実行手順に `--detectOpenHandles`(Jest側)を明記して CI または検証ログを添付 - 必要なら `UdpTransport.close(): Promise<void>` の設計検討結果をチケットに追記 残りイテレーション回数: 0回
…xで実行するように変更してください
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request focuses on making the SCTP teardown process robust, ensuring that after stopping, no asynchronous handles (timers, immediates) are left open and no timer rescheduling occurs. The changes introduce explicit stopping flags, guard all timer and input paths, and add regression tests to verify handle cleanup and prevent timer leaks. The implementation is careful to maintain backward compatibility and minimal impact on other components.
SCTP teardown and timer management improvements:
isStoppingandisClosedflags to theSCTPclass, and a unifiedisStoppedgetter to track and gate all teardown-related logic. All timer callbacks and rescheduling logic now check these flags to prevent timer regeneration after stopping. (packages/sctp/src/sctp.ts) [1] [2]timer1Expired,timer2Expired,timer3Expired,timerReconfigHandleExpired,transmit,sendSack,scheduleSack,handleData, etc.) to return early ifisStoppedis true, ensuring no new timers or async operations are scheduled post-stop. (packages/sctp/src/sctp.ts) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]stop()to clear all pending timer/immediate handles, settransport.onData = undefined, and ensure idempotence and no implicit transport closing, maintaining backward compatibility. (packages/sctp/src/sctp.ts) [1] [2]Testing and regression checks:
api.test.tsverifying that after sending many messages and stopping, no timers are rescheduled, all handles are cleared, andtransport.onDatais undefined. (packages/sctp/tests/api.test.ts)open-handles-check.ts) and npm script (test:open-handles) for automated open handle detection after SCTP teardown, ensuring no timer leaks in real scenarios. (packages/sctp/tests/open-handles-check.ts,packages/sctp/package.json) [1] [2]Documentation and planning:
TICKET-ticket-d57c0b1a-bdea-41a4-8c0e-bc21983606bf.md)