Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] ConcurrentBitSet is not thread safe #22360

Closed
2 of 3 tasks
lhotari opened this issue Mar 26, 2024 · 0 comments · Fixed by #22361
Closed
2 of 3 tasks

[Bug] ConcurrentBitSet is not thread safe #22360

lhotari opened this issue Mar 26, 2024 · 0 comments · Fixed by #22361
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@lhotari
Copy link
Member

lhotari commented Mar 26, 2024

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!
@lhotari lhotari added the type/bug The PR fixed a bug or issue reported a bug label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant