You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
stream/iter: per-consumer AbortSignal is ignored by broadcast.push() and share.pull() fast path #63302
import{setTimeoutasdelay}from"node:timers/promises";import{broadcast,share}from"node:stream/iter";asyncfunctioncheck(label,next){console.log(awaitPromise.race([next.then((value)=>`${label}: settled ${JSON.stringify(value)}`,(error)=>`${label}: rejected ${error?.name??error}`,),delay(50,`${label}: still pending`),]),);}{constac=newAbortController();const{broadcast: bc}=broadcast();constit=bc.push({signal: ac.signal})[Symbol.asyncIterator]();constnext=it.next();ac.abort(newError("abort"));awaitcheck("broadcast.push({ signal }).next()",next);}{constac=newAbortController();constshared=share((asyncfunction*never(){awaitnewPromise(()=>{});})(),);constit=shared.pull({signal: ac.signal})[Symbol.asyncIterator]();constnext=it.next();ac.abort(newError("abort"));awaitcheck("share.pull({ signal }).next()",next);}
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
broadcast.push({ signal }).next(): rejected Errorshare.pull({ signal }).next(): rejected Error
What do you see instead?
broadcast.push({ signal }).next(): still pendingshare.pull({ signal }).next(): still pending
Activity
stream: handle abort in iter consumers
stream: respect iter consumer abort signals
stream: respect iter consumer abort signals
stream: respect iter consumer abort signals