GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — AbortSignal.any() of another composite leaks: an observed outer composite outlives all of its sources · Issue #66612 · nodejs/node Closed DescriptionVersionv26.10.0 and v26.11.1. PlatformLinux arm64. Subsystemlib (abortcontroller) What steps will reproduce the bug?Run // node --expose-gc e3.mjs const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); const collect = async () => { for (let round = 0; round < 4; round++) { await sleep(10); globalThis.gc(); } }; for (const nested of [false, true]) { let sources = []; const handed = []; for (let i = 0; i < 8; i++) { (() => { const a = new AbortController(); const b = new AbortController(); sources.push(a, b); const composite = nested ? AbortSignal.any([a.signal, AbortSignal.any([b.signal])]) : AbortSignal.any([a.signal, b.signal]); const payload = new Uint8Array(2 ** 20); composite.addEventListener("abort", () => payload.fill(1)); handed.push(new WeakRef(composite)); })(); } // While the sources live, nothing holds the inner composite, which a collection takes first. await collect(); sources = undefined; await collect(); console.log(`nested: ${nested}; ${handed.filter(ref => ref.deref() !== undefined).length}/8 composites alive once their sources were collected`); } How often does it reproduce? Is there a required condition?Always: 5 of 5 runs on each version, when the inner composite is collected before its sources, as the repro arranges. If the order is left to the collector, it reproduces only sometimes. What is the expected behavior? Why is that the expected behavior?
What do you see instead?
Additional information
Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |