Skip to content

fix(pubsub): remove unused AckResult map#6656

Merged
hongalex merged 4 commits into
googleapis:mainfrom
hongalex:fix-remove-pending-ack-results
Sep 14, 2022
Merged

fix(pubsub): remove unused AckResult map#6656
hongalex merged 4 commits into
googleapis:mainfrom
hongalex:fix-remove-pending-ack-results

Conversation

@hongalex

Copy link
Copy Markdown
Member

iterator.pendingAckResults was supposed to store the pending ack results for exactly once delivery and shut them down on context cancellation. However, we don't do this since we wait for all messages to be acked/nacked/expired before shutting down the subscriber. I'm also removing this since the map currently has the possibility of creating a memory leak if messages are not properly acked/nacked.

@hongalex hongalex requested review from a team September 12, 2022 23:52
@product-auto-label product-auto-label Bot added size: s Pull request size is small. api: pubsub Issues related to the Pub/Sub API. labels Sep 12, 2022
@hongalex hongalex requested a review from shollyman as a code owner September 13, 2022 20:12
Comment thread pubsub/iterator.go
ackIDs := map[string]*AckResult{}
it.mu.Lock()
it.eoMu.RLock()
enableExactlyOnceDelivery := it.enableExactlyOnceDelivery

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is the only bit that bears scrutiny. Will not setting this affect any other behaviors?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was only for reading the field from the iterator object into a local variable. It was used for this function only.

@hongalex hongalex merged commit 5f69002 into googleapis:main Sep 14, 2022
gcf-merge-on-green Bot pushed a commit that referenced this pull request Oct 24, 2022
🤖 I have created a release *beep* *boop*
---


## [1.26.0](https://togithub.com/googleapis/google-cloud-go/compare/pubsub/v1.25.1...pubsub/v1.26.0) (2022-10-24)


### Features

* **pubsub:** Add support for snapshot labels ([#6835](https://togithub.com/googleapis/google-cloud-go/issues/6835)) ([c17851b](https://togithub.com/googleapis/google-cloud-go/commit/c17851b5c3d811cd3e6a28162f0e399bb31a1363))


### Bug Fixes

* **pubsub:** Remove unused AckResult map ([#6656](https://togithub.com/googleapis/google-cloud-go/issues/6656)) ([5f69002](https://togithub.com/googleapis/google-cloud-go/commit/5f690022551ac584e5c66af4324a17d7044a898d))


### Documentation

* **pubsub:** Fix comments on message for exactly once delivery ([#6878](https://togithub.com/googleapis/google-cloud-go/issues/6878)) ([a8109e2](https://togithub.com/googleapis/google-cloud-go/commit/a8109e2d3257d1698ce1b751618428ef25cbb859)), refs [#6877](https://togithub.com/googleapis/google-cloud-go/issues/6877)
* **pubsub:** Update streams section ([#6682](https://togithub.com/googleapis/google-cloud-go/issues/6682)) ([7b4e2b4](https://togithub.com/googleapis/google-cloud-go/commit/7b4e2b412058f965a9f9159231afe551a6f58a74))
* **pubsub:** Update subscription retry policy defaults ([#6909](https://togithub.com/googleapis/google-cloud-go/issues/6909)) ([c5c2f8f](https://togithub.com/googleapis/google-cloud-go/commit/c5c2f8f7125034c611edf1d08ca35ece6554c454)), refs [#6903](https://togithub.com/googleapis/google-cloud-go/issues/6903)

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
kimihrr pushed a commit to kimihrr/google-cloud-go-kimia that referenced this pull request Oct 25, 2022
🤖 I have created a release *beep* *boop*
---


## [1.26.0](https://togithub.com/googleapis/google-cloud-go/compare/pubsub/v1.25.1...pubsub/v1.26.0) (2022-10-24)


### Features

* **pubsub:** Add support for snapshot labels ([googleapis#6835](https://togithub.com/googleapis/google-cloud-go/issues/6835)) ([c17851b](https://togithub.com/googleapis/google-cloud-go/commit/c17851b5c3d811cd3e6a28162f0e399bb31a1363))


### Bug Fixes

* **pubsub:** Remove unused AckResult map ([googleapis#6656](https://togithub.com/googleapis/google-cloud-go/issues/6656)) ([5f69002](https://togithub.com/googleapis/google-cloud-go/commit/5f690022551ac584e5c66af4324a17d7044a898d))


### Documentation

* **pubsub:** Fix comments on message for exactly once delivery ([googleapis#6878](https://togithub.com/googleapis/google-cloud-go/issues/6878)) ([a8109e2](https://togithub.com/googleapis/google-cloud-go/commit/a8109e2d3257d1698ce1b751618428ef25cbb859)), refs [googleapis#6877](https://togithub.com/googleapis/google-cloud-go/issues/6877)
* **pubsub:** Update streams section ([googleapis#6682](https://togithub.com/googleapis/google-cloud-go/issues/6682)) ([7b4e2b4](https://togithub.com/googleapis/google-cloud-go/commit/7b4e2b412058f965a9f9159231afe551a6f58a74))
* **pubsub:** Update subscription retry policy defaults ([googleapis#6909](https://togithub.com/googleapis/google-cloud-go/issues/6909)) ([c5c2f8f](https://togithub.com/googleapis/google-cloud-go/commit/c5c2f8f7125034c611edf1d08ca35ece6554c454)), refs [googleapis#6903](https://togithub.com/googleapis/google-cloud-go/issues/6903)

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
@hongalex hongalex deleted the fix-remove-pending-ack-results branch December 10, 2025 22:48
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: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants