apache / apache/pulsar

[Bug] BucketDelayedDeliveryTracker.containsMessage is not thread-safe, but it's called from another thread

Open
#23,190 5 comments 0 reactions 1 assignee Claimed by @dao-jun View on GitHub
type/bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.