You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Subscribing to topic executes work on the single threaded Pulsar metadata thread in some cases #23866
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
All released versions
Minimal reproduce step
Subscribe to a topic when metadata isn't yet cached.
What did you expect to see?
The topic ordered executor to be used.
What did you see instead?
configuration-metadata-store executor was used:
It's this executor:
Confirmed on current master. In ServerCnx.handleSubscribe (pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2383 on master), topic.subscribe(option) is chained with thenCompose onto BrokerService.isAllowAutoSubscriptionCreationAsync() (BrokerService.java:4903), which reads the namespace policies through getPoliciesAsync. On a cache miss that future completes on the configuration-metadata-store thread, so the subscribe and everything after it run on the single metadata thread. The likely fix is to switch to thenComposeAsync on the topic's ordered executor (or ctx.executor()) before calling topic.subscribe. ServerCnx.java:2837 (the producer's initial subscription) has the same pattern.
Activity
merlimat commentedon Oct 24, 2026
Confirmed on current master. In
ServerCnx.handleSubscribe(pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:2383 on master),topic.subscribe(option)is chained withthenComposeontoBrokerService.isAllowAutoSubscriptionCreationAsync()(BrokerService.java:4903), which reads the namespace policies throughgetPoliciesAsync. On a cache miss that future completes on the configuration-metadata-store thread, so the subscribe and everything after it run on the single metadata thread. The likely fix is to switch tothenComposeAsyncon the topic's ordered executor (orctx.executor()) before callingtopic.subscribe. ServerCnx.java:2837 (the producer's initial subscription) has the same pattern.