Skip to content

[Bug] ConcurrentBitSet is not thread safe #22360

Closed

Description

@lhotari

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

Version

ConcurrentBitSet was introduced in Pulsar 2.4.0

Minimal reproduce step

ConcurrentBitSet claims to be a multi-thread safe class.

There are several problems:

  • It contains invalid use of StampedLock class. It isn't using write lock, which makes the use of StampedLock useless.
  • Many used methods aren't handled. for example .clear() method.

ConcurrentBitSet.clear is called here:

What did you expect to see?

  • ConcurrentBitSet should properly use StampedLock
  • It should make most methods thread safe and prevent usage of other non-thread safe fields.

What did you see instead?

ConcurrentBitSet is not thread safe

Anything else?

This is related to issue #22352

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    type/bug
    on Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions