Description
In src/stellar/resilience.ts:101-108, when the wrapped promise resolves before the timeout, the setTimeout timer and its rejection callback remain pending. Under sustained load, this creates a growing number of unresolved timers and associated callbacks.
Impact
Memory leak under sustained load — timers accumulate without being cleaned up.
File
src/stellar/resilience.ts:101-108
Suggested Fix
Clear the timeout with clearTimeout when the wrapped promise resolves or rejects before the timeout fires.
Description
In
src/stellar/resilience.ts:101-108, when the wrapped promise resolves before the timeout, thesetTimeouttimer and its rejection callback remain pending. Under sustained load, this creates a growing number of unresolved timers and associated callbacks.Impact
Memory leak under sustained load — timers accumulate without being cleaned up.
File
src/stellar/resilience.ts:101-108Suggested Fix
Clear the timeout with
clearTimeoutwhen the wrapped promise resolves or rejects before the timeout fires.