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
Apply the patch above to the main branch and run ConsumerSeekTest.testSubscribeSeekRaces.
What did you expect to see?
The seek call should return quickly.
What did you see instead?
The seek call is blocked.
Anything else?
This bug happened in the following process order:
Consumer sent a SEEK request, the seek status was set to IN_PROGRESS and the callback was assigned to seekCallback_
Broker disconnected and started resetting the cursor
Consumer received a CLOSE_CONSUMER request and scheduled reconnection after 100ms
Consumer reconnected and call connectionOpened. Since the seek status is IN_PROGRESS, it would not trigger the seek callback. A SUBSCRIBE request would be sent.
Consumer received a SEEK response. Since the SUBSCRIBE response was not received for now, the cnx field was not set, so the seek status was set to COMPLETE and wait for connectionOpened to complete the callback
Activity
BewareMyPower commentedon Jan 15, 2026
It has a high chance to happen because a pending subscribe request will wait for the reset cursor task is done, see https://github.com/apache/pulsar/blob/99fdca8af6742dd36bec93ab0038fb572e6eeb0e/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java#L237
So once the seek response is received before the CLOSE_CONSUMER request, the issue could happen