Skip to content

fix(pubsub/v2): respect ShutdownBehavior when handling timeout#13021

Merged
hongalex merged 1 commit intogoogleapis:mainfrom
kurochan:pubsubv2-shutdown-behavior
Oct 3, 2025
Merged

fix(pubsub/v2): respect ShutdownBehavior when handling timeout#13021
hongalex merged 1 commit intogoogleapis:mainfrom
kurochan:pubsubv2-shutdown-behavior

Conversation

@kurochan
Copy link
Contributor

@kurochan kurochan commented Oct 2, 2025

Previously, ShutdownOptions.Behavior was never respected — when a positive Timeout was set, messages were always nacked. This PR fixes the shutdown logic so that messages are only nacked if Behavior is explicitly set to ShutdownBehaviorNackImmediately. This makes the Behavior field effective as intended.

related to #12829

@kurochan kurochan requested a review from shollyman as a code owner October 2, 2025 05:08
@kurochan kurochan requested review from a team October 2, 2025 05:08
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Oct 2, 2025
@hongalex
Copy link
Member

hongalex commented Oct 2, 2025

Thanks for the PR. This was originally part of the implementation, but I had dropped it at some point when debugging another issue. Looks good to me.

@hongalex hongalex added the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 2, 2025
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Oct 2, 2025
Previously, messages were always nacked when a positive shutdown timeout was set. This change ensures that messages are only nacked if ShutdownBehavior is explicitly set to NackImmediately.
@kurochan kurochan force-pushed the pubsubv2-shutdown-behavior branch from 3f8ebbd to 741bdf5 Compare October 3, 2025 01:44
@kurochan kurochan requested a review from a team October 3, 2025 01:44
@hongalex hongalex added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 3, 2025
@hongalex hongalex enabled auto-merge (squash) October 3, 2025 17:30
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 3, 2025
@hongalex hongalex merged commit 0135d93 into googleapis:main Oct 3, 2025
77 checks passed
hongalex pushed a commit that referenced this pull request Oct 3, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.2.0](pubsub/v2/v2.1.0...pubsub/v2/v2.2.0)
(2025-10-03)


### Features

* **pubsub/v2:** Support the protocol version in StreamingPullRequest
([#12985](#12985))
([4e8c9d5](4e8c9d5))


### Bug Fixes

* **pubsub/v2:** Respect ShutdownBehavior when handling timeout
([#13021](#13021))
([0135d93](0135d93))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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.

4 participants