Version
main
Platform
Subsystem
stream
What steps will reproduce the bug?
import {
array,
arrayBuffer,
bytes,
text,
} from 'node:stream/iter';
import { setTimeout } from 'node:timers/promises';
async function* never() {
await new Promise(() => {});
}
async function check(name, fn) {
const ac = new AbortController();
setTimeout(10).then(() => ac.abort(new Error('boom')));
const result = await Promise.race([
fn(never(), { signal: ac.signal })
.then(() => `${name} resolved`)
.catch((err) => `${name} rejected: ${err.message}`),
setTimeout(80, `${name} timeout`),
]);
console.log(result);
}
await check('bytes', bytes);
await check('text', text);
await check('arrayBuffer', arrayBuffer);
await check('array', array);
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
bytes rejected: boom
text rejected: boom
arrayBuffer rejected: boom
array rejected: boom
What do you see instead?
bytes timeout
text timeout
arrayBuffer timeout
array timeout
All four consumers accept { signal }, but aborting the signal does not settle the operation while the source’s async iterator is stuck in a pending next(). They should reject promptly with the abort reason instead of waiting for another batch to arrive.
Additional information
No response
Version
main
Platform
Subsystem
stream
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
What do you see instead?
All four consumers accept
{ signal }, but aborting the signal does not settle the operation while the source’s async iterator is stuck in a pendingnext(). They should reject promptly with the abort reason instead of waiting for another batch to arrive.Additional information
No response