Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pubsublite): fix committer races #3810

Merged
merged 4 commits into from Mar 16, 2021
Merged

Conversation

tmdiep
Copy link
Contributor

@tmdiep tmdiep commented Mar 12, 2021

Races:

  1. When Stop is called before Terminate when there are outstanding acks, the committer did not transition to serviceTerminated. Terminate clears outstanding acks, so unsafeCheckDone needs to be called to check whether the committer can now shut down.
  2. If there is a pending commit, and Stop or Terminate are called just before the stream is connected, it can send a commit to the server before onStreamStatusChange performs the necessary state initialization for the streamConnected signal. So we add an enableCommits flag to ensure onStreamStatusChange processes the streamConnected signal first.

Simplified TestAssigningSubscriberIgnoreOutstandingAcks, which detected these races.

Fixes #3791.

@tmdiep tmdiep requested review from a team as code owners March 12, 2021 23:15
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Mar 12, 2021
@product-auto-label product-auto-label bot added the api: pubsublite Issues related to the Pub/Sub Lite API. label Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsublite Issues related to the Pub/Sub Lite API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pubsublite/internal/wire: TestAssigningSubscriberIgnoreOutstandingAcks failed
2 participants