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
* fix: possible EventEmitter memory leak detected
* Single place for AbortSignal listeners -> #6789 (#6793)
* Single place for AbortSignal listeners
* Fix
* ..
* Lets go
* Small improvement
* Changeset for utils
* Update packages/executor/src/execution/__tests__/abort-signal.test.ts
---------
Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
- New helper function `getAbortPromise` to get a promise rejected when `AbortSignal` is aborted
6
+
- New helper function `registerAbortSignalListener` to register a listener to abort a promise when `AbortSignal` is aborted
7
+
8
+
Instead of using `.addEventListener('abort', () => {/* ... */})`, we register a single listener to avoid warnings on Node.js like `MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 abort listeners added. Use emitter.setMaxListeners() to increase limit`.
Surpress the "possible EventEmitter memory leak detected." warning occuring on Node.js when passing
6
+
a `AbortSignal` to `execute`.
7
+
8
+
Each execution will now only set up a single listener on the supplied `AbortSignal`. While the warning is harmless it can be misleading, which is the main motivation of this change.
0 commit comments