Skip to content

Concurrent delete subscription and delete topic lead to memory leak #12239

Description

@hezhangjian

Describe the bug
Concurrent request delete subscription A and delete topic B will lead to leak ManagerLedgerImplManagerCursorImpl、and any object related to them leak.
That's the work flow

Step1

A delete the cursor ledger.asyncDeleteCursor, but don't remove the subscription from ConcurrentOpenHashMap<String, PersistentSubscription> subscriptions;

Step2

Second, B delete the topic, as long as the subscription in subscriptions, B try to delete the cursor. Because of the cursor already been delete in Step1, delete topic failed

Step3

A remove the subscrption from subscriptions

That lead to memory leak, can't free ManagerLedgerImplManagerCursorImpl、and any object related to them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions