Skip to content

feat(pubsub): retry batches for ordering key messages forever#4722

Merged
suzmue merged 3 commits intogoogleapis:mainfrom
suzmue:longretry
Feb 19, 2026
Merged

feat(pubsub): retry batches for ordering key messages forever#4722
suzmue merged 3 commits intogoogleapis:mainfrom
suzmue:longretry

Conversation

@suzmue
Copy link
Copy Markdown
Collaborator

@suzmue suzmue commented Feb 18, 2026

The Pub/Sub client libraries support ordered publishing for messages with ordering keys. Publishing for an ordering key is stopped when there is a permanent error. Since the cost of failing on trayient libraries will retry transient errors indefinitely.

This change overrides the retry policy for batches with ordering keys. There is currently no way to configure this retry policy for the clients, we may wish to add one in the future.

For #4013

@suzmue suzmue requested a review from a team as a code owner February 18, 2026 22:28
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Feb 18, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.08%. Comparing base (a13e492) to head (20b5633).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4722      +/-   ##
==========================================
- Coverage   95.09%   95.08%   -0.01%     
==========================================
  Files         198      198              
  Lines        7599     7606       +7     
==========================================
+ Hits         7226     7232       +6     
- Misses        373      374       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coryan
Copy link
Copy Markdown
Collaborator

coryan commented Feb 19, 2026

"forever" scares me.... does that literally mean that the client library will retry without any stop condition? Regardless of the number of attempts or the time trying? Is that a default? Can applications override it?

@suzmue
Copy link
Copy Markdown
Collaborator Author

suzmue commented Feb 19, 2026

"forever" scares me.... does that literally mean that the client library will retry without any stop condition? Regardless of the number of attempts or the time trying? Can applications override it?

Yes, forever means forever.

Is that a default?

Its the default for messages with ordering keys

Can applications override it?

Not currently.

This is the guidance for how to implement ordering in the publisher (see go/ordering-keys-library).

If we are scared of actual forever, I think some of the other high level client libraries use a time limit that is Duration::MAX, but I think that is a product of how their retries are implemented, and it is effectively the same.

@suzmue suzmue merged commit dcc3edd into googleapis:main Feb 19, 2026
35 checks passed
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants