next.js
9affa18e - [dynamicIO] Avoid memory leak warning for hanging promises (#77480)

Commit
278 days ago
[dynamicIO] Avoid memory leak warning for hanging promises (#77480) Node.js tries to help you avoid memory leaks by detecting when a lot of event listeners are set for a single AbortSignal. Next.js uses abort signal listeners to do cleanup on hanging promises and so this usage is not a memory leak however to avoid creating concern amongst users we need to work around the listener count limit. This is unfortunate b/c it is otherwise useless code to add but our alternative is to turn off this leak detection or raise the limit significantly, neither of which are great options since there may be other uses where this protection is useful to our users. In this change I implement the abort listening by a delegated event listener
Author
Parents
Loading