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
bug(queue): AsyncQueue leaks pending resolvers on abandoned iteration #34984
When a consumer stops iterating a for await...of loop over AsyncQueue before consuming all items, the pending resolver callbacks in the resolvers array are never cleaned up, causing a memory leak.
Steps to reproduce
Create AsyncQueue and push items
Start iterating with for await...of
Break early before consuming all items
Pending resolvers remain in the array indefinitely
Expected
Abandoning iteration should clean up pending resolvers.
If your issue describes a distinct scenario (e.g., a for await...of consumer breaking early rather than SSE-specific stalls), it may still be worth keeping open as a separate code path. But please review the above to see if they cover your case.
This covers a distinct scenario from the SSE memory leaks (#22198, #31923). Those are about server-side zombie TCP connections where the server never detects client disconnect — the fix there belongs in the SSE/connection layer.
This issue is about the general-purpose AsyncQueue having no way to clean up pending resolvers when a consumer deliberately abandons iteration (e.g. break/return from for await...of). The fix is adding a close() method so any consumer can terminate the queue cleanly.
The two issues share the same utility class but have different root causes and different fix locations. This one is a prerequisite for any queue-level cleanup regardless of the SSE story.
Activity
github-actions commentedon Jul 2, 2026
This issue might be a duplicate of existing issues related to
AsyncQueueand memory leaks. Please check:AsyncQueuegrowth when SSE consumers stop draining — directly related toAsyncQueuenot cleaning up when iteration is abandonedIf your issue describes a distinct scenario (e.g., a
for await...ofconsumer breaking early rather than SSE-specific stalls), it may still be worth keeping open as a separate code path. But please review the above to see if they cover your case.HEETMEHTA18 commentedon Jul 2, 2026
This covers a distinct scenario from the SSE memory leaks (#22198, #31923). Those are about server-side zombie TCP connections where the server never detects client disconnect — the fix there belongs in the SSE/connection layer.
This issue is about the general-purpose
AsyncQueuehaving no way to clean up pending resolvers when a consumer deliberately abandons iteration (e.g.break/returnfromfor await...of). The fix is adding aclose()method so any consumer can terminate the queue cleanly.The two issues share the same utility class but have different root causes and different fix locations. This one is a prerequisite for any queue-level cleanup regardless of the SSE story.
github-actions commentedon Sep 1, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.