You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "BewareMyPower (via GitHub)" <gi...@apache.org> on 2026/01/15 10:38:43 UTC
[I] [Bug] seek could sometimes be stuck [pulsar-client-cpp]
BewareMyPower opened a new issue, #534:
URL: https://github.com/apache/pulsar-client-cpp/issues/534
### Search before asking
- [x] I searched in the [issues](https://github.com/apache/pulsar-client-cpp/issues) and found nothing similar.
### Version
master
### Minimal reproduce step
[reproduce.diff.txt](https://github.com/user-attachments/files/24638253/reproduce.diff.txt)
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:
1. Consumer sent a SEEK request, the seek status was set to `IN_PROGRESS` and the callback was assigned to `seekCallback_`
2. Broker disconnected and started resetting the cursor
3. Consumer received a CLOSE_CONSUMER request and scheduled reconnection after 100ms
4. 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.
5. 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**
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] seek could sometimes be stuck [pulsar-client-cpp]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on issue #534:
URL: https://github.com/apache/pulsar-client-cpp/issues/534#issuecomment-3754132907
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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] seek could sometimes be stuck [pulsar-client-cpp]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower closed issue #534: [Bug] seek could sometimes be stuck
URL: https://github.com/apache/pulsar-client-cpp/issues/534
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org