MaxListenersExceededWarning
showing on the latest version when using an AbortController
#1318
Labels
closing-soon
This issue will automatically close in 2 days unless further comments are made.
First up, sorry for an ignorance as to if this is an issue or not, I'm not super well versed in this library or AbortController overall.
We (bbc/sqs-consumer) recently received an issue around a
MaxListenersExceededWarning
showing after upgrading to the latest version of AWS-sdk (bbc/sqs-consumer#500).It looks like this stems from the changes made to AbortController here:
https://github.com/smithy-lang/smithy-typescript/releases/tag/%40smithy/node-http-handler%403.1.0
On investigation, it looks like this library is adding event listeners here (and elsewhere): https://github.com/smithy-lang/smithy-typescript/pull/1308/files#diff-98216b22e6b39a1cd6f2ab013304d4964152b554c4ad8fee4182a961b42285d8R192
And then not removing them.
This seems to be a bit different to implementations I've seen elsewhere, where the listener is added and then removed, such as in undici: https://github.com/nodejs/undici/blob/3fd1fe1a98fe49dcf7629f5d974246dae2692883/lib/core/util.js#L519
What I'm wondering is if this is the cause of the issue, and if it is, could it be fixed here?
We've had a suggestion to change how we use the AbortController to initialise at the start of every call, rather than globally, that needs some investigation as to if that's the fix or not, but I'm also wondering if that is just moving to having an issue elsewhere, down the road.
What's the expectation for libraries using this library here?
The text was updated successfully, but these errors were encountered: