Skip to content

[Bug][Java client] Possible race condition in closing consumer which causes a leak in memory limit controller and direct memory with pooled messages #18938

Description

@lhotari

Search before asking

  • I searched in the issues and found nothing similar.

Version

master

Minimal reproduce step

This was an issue that came up in PR review comment #18928 (comment)

What did you expect to see?

There shouldn't be a race between org.apache.pulsar.client.impl.ConsumerImpl#closeAsync and org.apache.pulsar.client.impl.ConsumerImpl#messageReceived .

What did you see instead?

It's possible that closeAsync and messageReceived are in a race and incoming messages don't get properly cleaned up. This can cause a leak in the memory limit controller and also leak direct memory.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Staletype/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