Skip to content

[MEDIUM] withTimeout leaks pending timers #32

Description

@DeFiVC

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't workingmedium

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions