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(pubsub): check response of receipt modacks for exactly once delivery #7568

Merged
merged 9 commits into from
Mar 22, 2023

Conversation

hongalex
Copy link
Member

@hongalex hongalex commented Mar 16, 2023

This PR aligns the behavior of receipt modacks with the Python client. Specifically, if exactly once delivery is enabled, receipt modacks that fail should be retried up to 3 times (similar to lease modacks), but message processing should be blocked on the result of this modack.

This PR also removes a test with the fake since DeadlineExceeded errors will never happen in the Nack case if modacks are never successful.

Fixes #7585

@hongalex hongalex requested review from a team and shollyman as code owners March 16, 2023 02:10
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: pubsub Issues related to the Pub/Sub API. labels Mar 16, 2023
…oogle-cloud-go; branch 'main' of github.com:googleapis/google-cloud-go into fix-pubsub-receipt-modack-eod
if err != nil {
delete(pendingMessages, ackID)
it.mu.Lock()
defer it.mu.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

This defer seems problematic for unlocking. What happens when a second entry in this for loop has an error?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch, removed the use of defer here

@hongalex hongalex requested a review from shollyman March 17, 2023 22:49
@hongalex hongalex added the automerge Merge the pull request once unit tests and other checks pass. label Mar 22, 2023
@hongalex hongalex merged commit 94d0408 into googleapis:main Mar 22, 2023
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Mar 22, 2023
@hongalex hongalex deleted the fix-pubsub-receipt-modack-eod branch March 22, 2023 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pubsub: exactly-once delivery should wait for the receipt modAck to succeed before proceeding
3 participants