Found while investigating an undici bug...
closeStream() sets STREAM_FLAGS_CLOSED, then emits 'aborted' synchronously before calling finishCloseStream(). If a listener destroys the stream, _destroy() skips its own RST because this.closed is already true, and destroys the handle. submitRstStream() then finds no handle and no RST_STREAM is sent. The peer's stream stays open until the session closes.
stream.pipeline(src, http2Stream) triggers this by itself: Http2Stream has autoDestroy: false, so eos listens for 'aborted' and destroys on it.
Found while investigating an undici bug...
closeStream()setsSTREAM_FLAGS_CLOSED, then emits'aborted'synchronously before callingfinishCloseStream(). If a listener destroys the stream,_destroy()skips its own RST becausethis.closedis alreadytrue, and destroys the handle.submitRstStream()then finds no handle and noRST_STREAMis sent. The peer's stream stays open until the session closes.stream.pipeline(src, http2Stream)triggers this by itself: Http2Stream hasautoDestroy: false, soeoslistens for'aborted'and destroys on it.