[Bug] BucketDelayedDeliveryTracker.containsMessage is not thread-safe, but it's called from another thread
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Read release policy
- [X] 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
any released version of Pulsar
### Minimal reproduce step
There's code that calls BucketDelayedDeliveryTracker.containsMessage.containsMessage from another thread
https://github.com/apache/pulsar/blob/1c53841cc7f585bdd8ff6702d74f37491d8cc9c6/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java#L389-L392
### What did you expect to see?
Having thread-safety aspects considered in the BucketDelayedDeliveryTracker implementation.
### What did you see instead?
There seem to be thread safety issues in BucketDelayedDeliveryTracker
### Anything else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Contributor guide
Assessment
This issue has not been assessed yet.