Skip to content

Conversation

@BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented Jan 14, 2026

Fixes #534

Use mutex_ to synchronize the following two composited tasks:

  1. Call setCnx, cnx->registerConsumer and clearReceiveQueue directly block in connectionOpened. Once it's detected the status is COMPLETED, delay the callback completion after the subscribe response is processed.
  2. When receiving a seek response, only set the status to COMPLETED when the reconnection is not done.

Since now many accesses to message id fields are also protected by the mutex_, remove mutexForMessageId_ and protect other accesses by mutex_ as well.

Add more debug logs to ClientConnection and support mocking some requests with specific latencies, as well as new tests testSubscribeSeekRaces and testReconnectionSlow to cover all possible cases.

@BewareMyPower BewareMyPower self-assigned this Jan 14, 2026
@BewareMyPower BewareMyPower added this to the 4.1.0 milestone Jan 14, 2026
@BewareMyPower BewareMyPower requested a review from Copilot January 14, 2026 07:39
@BewareMyPower BewareMyPower marked this pull request as draft January 14, 2026 08:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@BewareMyPower
Copy link
Contributor Author

cc @gaoran10 as well since you also have the context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] seek could sometimes be stuck

1 participant