LogSubscription warning MaxListenersExceededWarning: Possible EventTarget memory leak detected.
#3624
Labels
bug
Something isn't working
Overview
Hi all, I've started playing with the 2.x version of the SDK and pretty happy with it overall. I've now wanted to add 3 logsListeners with a filter of my address for the different commitment levels and while it works fine for 2 logs subscriptions, once I add a 3rd node events gets unhappy with
When I reduce the
maxSubscriptionsPerChannel
config in thecreateSolanaRpcSubscriptions
to say 2, the warning goes away fyi. The issue varies and sometimes complains aboutAbortSignal
and sometimes aboutEventTarget
Steps to reproduce
Description of bug
I did not expect to see this warning and more so would like for a way to set the limits such that it does not warn
EventTarget warning:
(node:54008) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 error listeners added to EventTarget. MaxListeners is 10. Use events.setMaxListeners() to increase limit at [kNewListener] (node:internal/event_target:566:17) at EventTarget.addEventListener (node:internal/event_target:679:23) at Object.on (/Users/chris/Projects/spot/node_modules/@solana/subscribable/src/data-publisher.ts:28:26) at Object.on (/Users/chris/Projects/spot/node_modules/@solana/rpc-subscriptions-spec/src/rpc-subscriptions-channel.ts:38:32) at Object.on (/Users/chris/Projects/spot/node_modules/@solana/rpc-subscriptions-spec/src/rpc-subscriptions-pubsub-plan.ts:207:36) at Object.createAsyncIterableFromDataPublisher (/Users/chris/Projects/spot/node_modules/@solana/subscribable/src/async-iterable.ts:87:19) at Object.subscribe (/Users/chris/Projects/spot/node_modules/@solana/rpc-subscriptions-spec/src/rpc-subscriptions.ts:72:20) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
AbortSignal warning:
(node:54231) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit at [kNewListener] (node:internal/event_target:566:17) at [kNewListener] (node:internal/abort_controller:240:24) at EventTarget.addEventListener (node:internal/event_target:679:23) at Object.createAsyncIterableFromDataPublisher (/Users/chris/Projects/spot/node_modules/@solana/subscribable/src/async-iterable.ts:81:17) at Object.subscribe (/Users/chris/Projects/spot/node_modules/@solana/rpc-subscriptions-spec/src/rpc-subscriptions.ts:72:20) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
The text was updated successfully, but these errors were encountered: