Repository navigation
chore: refactor Google Pub/Sub to add retry logic for auth errors - #6229
Merged
koladilip merged 2 commits intoAug 13, 2025
Merged
Conversation
koladilip
force-pushed
the
feature/RUD-2463-googlepubsub-retry-auth-errors
branch
2 times, most recently
from
August 12, 2025 16:51
521ab34 to
6f4e1cf
Compare
Contributor
Author
|
Tested locally these changes. |
atzoum
reviewed
Aug 12, 2025
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/1.56.x #6229 +/- ##
==================================================
+ Coverage 76.84% 76.98% +0.13%
==================================================
Files 511 511
Lines 69986 70025 +39
==================================================
+ Hits 53780 53906 +126
+ Misses 13309 13240 -69
+ Partials 2897 2879 -18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
koladilip
force-pushed
the
feature/RUD-2463-googlepubsub-retry-auth-errors
branch
6 times, most recently
from
August 13, 2025 05:38
c3f1dad to
c1a8303
Compare
atzoum
approved these changes
Aug 13, 2025
- Add publishWithRetry method with exponential backoff - Retry up to 3 times on authentication errors only - Use 100ms, 200ms, 400ms backoff delays - Mark non-auth errors as permanent to avoid retries - Add logging for retry attempts and failures
- Use backoff v4 instead of v2 - Move config from global variables to GooglePubSubProducer struct - Make retry parameters configurable with reloadable config - Simplify publish method to single line - Use specific error string matching instead of gRPC codes - Improve logging to include error details - Return original errors instead of wrapping - Use proper config function signatures
atzoum
force-pushed
the
feature/RUD-2463-googlepubsub-retry-auth-errors
branch
from
August 13, 2025 13:02
c1a8303 to
6fc6ba8
Compare
ItsSudip
approved these changes
Aug 13, 2025
ItsSudip
left a comment
Member
There was a problem hiding this comment.
Looks good to me. One suggestion, I can see v5 is available of backoff package, can we upgrade to that?
Contributor
Author
we can do that as separate pr |
Merged
achettyiitr
pushed a commit
that referenced
this pull request
Aug 18, 2025
🤖 I have created a release *beep* *boop* --- ## [1.56.3](v1.56.2...v1.56.3) (2025-08-14) ### Bug Fixes * getting occasional unauthenticated errors from googlepubsub ([#6228](#6228)) ([5aaadfb](5aaadfb)) * handling empty schema for table level schemas ([#6233](#6233)) ([41b531b](41b531b)) * histogram buckets for schema snapshots ([#6234](#6234)) ([e0aafda](e0aafda)) ### Miscellaneous * refactor Google Pub/Sub to add retry logic for auth errors ([#6229](#6229)) ([5bb6589](5bb6589)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
mihir20
pushed a commit
that referenced
this pull request
Aug 18, 2025
# Description Syncing patch release v1.56.3 to main branch **↓↓ Please review and edit commit overrides before merging ↓↓** BEGIN_COMMIT_OVERRIDE fix: getting occasional unauthenticated errors from googlepubsub (#6228) fix: handling empty schema for table level schemas (#6233) chore: refactor Google Pub/Sub to add retry logic for auth errors (#6229) fix: histogram buckets for schema snapshots (#6234) END_COMMIT_OVERRIDE --------- Co-authored-by: Akash Chetty <[email protected]> Co-authored-by: Aris Tzoumas <[email protected]> Co-authored-by: Dilip Kola <[email protected]>
This was referenced Aug 18, 2025
Merged
mihir20
pushed a commit
that referenced
this pull request
Aug 18, 2025
🤖 I have created a release *beep* *boop* --- ## [1.57.0-rc.1](v1.56.0...v1.57.0-rc.1) (2025-08-18) ### Features * add support for manual sync mode in warehouse ([#6199](#6199)) ([6f87119](6f87119)) * **router:** support different throttler per event type ([#6181](#6181)) ([12254bb](12254bb)) * warehouse grpc API to get namespace mappings of a destination ([#6200](#6200)) ([9613236](9613236)) ### Bug Fixes * adaptive throttling not applying dynamic throttling limits consistently ([#6219](#6219)) ([478b2e1](478b2e1)) * error extractor to handle nested JSON responses ([#6209](#6209)) ([ffc0d7a](ffc0d7a)) * getting occasional unauthenticated errors from googlepubsub ([#6228](#6228)) ([cc39306](cc39306)) * handle snowpipe service restarts in destination polling logic ([#6236](#6236)) ([b76bc7f](b76bc7f)) * handling empty schema for table level schemas ([#6233](#6233)) ([cc39306](cc39306)) * histogram buckets for schema snapshots ([#6234](#6234)) ([cc39306](cc39306)) * warehouse source empty jobs ([#6204](#6204)) ([42f5ae4](42f5ae4)) ### Miscellaneous * bump the go-dependencies group with 12 updates ([#6189](#6189)) ([e6e2bcd](e6e2bcd)) * enforcing non-sugared logger ([#6066](#6066)) ([b24ded8](b24ded8)) * force new MTU metrics from 1st September 2025 onwards ([#6227](#6227)) ([154d2c3](154d2c3)) * implement configurable deduplication mirror mode ([#6224](#6224)) ([c97ad7a](c97ad7a)) * refactor Google Pub/Sub to add retry logic for auth errors ([#6229](#6229)) ([cc39306](cc39306)) * remove enableV2NotifierJob flag support ([#6196](#6196)) ([8be54bf](8be54bf)) * remove event blocking flag ([#6240](#6240)) ([e668e14](e668e14)) * remove queryWithUploadId flag support for load files ([#6192](#6192)) ([e6e2bcd](e6e2bcd)) * revert "fix: snowpipe events getting duplicated if status API fails" ([#6211](#6211)) ([777b08e](777b08e)) * skip warehouse destinations from version deprecation error extraction ([#6226](#6226)) ([87c3320](87c3320)) * stop collecting errors in proc_error jobsdb ([#6232](#6232)) ([c600968](c600968)) * throttler should emit no warning if not enabled ([#6223](#6223)) ([0773168](0773168)) * update keydb dependency ([#6222](#6222)) ([d1d64bc](d1d64bc)) * use harbor to pull docker images ([#6210](#6210)) ([6c324cf](6c324cf)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
ItsSudip
pushed a commit
that referenced
this pull request
Aug 19, 2025
🤖 I have created a release *beep* *boop* --- ## [1.57.0-rc.2](v1.56.0...v1.57.0-rc.2) (2025-08-19) ### Features * add support for manual sync mode in warehouse ([#6199](#6199)) ([6f87119](6f87119)) * enable oauthV2 by removing oauthV2enabled variable ([#6175](#6175)) ([caad8f0](caad8f0)) * **router:** support different throttler per event type ([#6181](#6181)) ([12254bb](12254bb)) * warehouse grpc API to get namespace mappings of a destination ([#6200](#6200)) ([9613236](9613236)) ### Bug Fixes * adaptive throttling not applying dynamic throttling limits consistently ([#6219](#6219)) ([478b2e1](478b2e1)) * error extractor to handle nested JSON responses ([#6209](#6209)) ([ffc0d7a](ffc0d7a)) * getting occasional unauthenticated errors from googlepubsub ([#6228](#6228)) ([cc39306](cc39306)) * handle snowpipe service restarts in destination polling logic ([#6236](#6236)) ([b76bc7f](b76bc7f)) * handling empty schema for table level schemas ([#6233](#6233)) ([cc39306](cc39306)) * histogram buckets for schema snapshots ([#6234](#6234)) ([cc39306](cc39306)) * warehouse source empty jobs ([#6204](#6204)) ([42f5ae4](42f5ae4)) ### Miscellaneous * bump the go-dependencies group with 12 updates ([#6189](#6189)) ([e6e2bcd](e6e2bcd)) * enforcing non-sugared logger ([#6066](#6066)) ([b24ded8](b24ded8)) * force new MTU metrics from 1st September 2025 onwards ([#6227](#6227)) ([154d2c3](154d2c3)) * implement configurable deduplication mirror mode ([#6224](#6224)) ([c97ad7a](c97ad7a)) * refactor Google Pub/Sub to add retry logic for auth errors ([#6229](#6229)) ([cc39306](cc39306)) * remove enableV2NotifierJob flag support ([#6196](#6196)) ([8be54bf](8be54bf)) * remove event blocking flag ([#6240](#6240)) ([e668e14](e668e14)) * remove queryWithUploadId flag support for load files ([#6192](#6192)) ([e6e2bcd](e6e2bcd)) * revert "fix: snowpipe events getting duplicated if status API fails" ([#6211](#6211)) ([777b08e](777b08e)) * skip warehouse destinations from version deprecation error extraction ([#6226](#6226)) ([87c3320](87c3320)) * stop collecting errors in proc_error jobsdb ([#6232](#6232)) ([c600968](c600968)) * throttler should emit no warning if not enabled ([#6223](#6223)) ([0773168](0773168)) * update keydb dependency ([#6222](#6222)) ([d1d64bc](d1d64bc)) * use harbor to pull docker images ([#6210](#6210)) ([6c324cf](6c324cf)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
mihir20
pushed a commit
that referenced
this pull request
Aug 19, 2025
🤖 I have created a release *beep* *boop* --- ## [1.57.0](v1.56.0...v1.57.0) (2025-08-19) ### Features * add support for manual sync mode in warehouse ([#6199](#6199)) ([6f87119](6f87119)) * enable oauthV2 by removing oauthV2enabled variable ([#6175](#6175)) ([caad8f0](caad8f0)) * **router:** support different throttler per event type ([#6181](#6181)) ([12254bb](12254bb)) * warehouse grpc API to get namespace mappings of a destination ([#6200](#6200)) ([9613236](9613236)) ### Bug Fixes * adaptive throttling not applying dynamic throttling limits consistently ([#6219](#6219)) ([478b2e1](478b2e1)) * error extractor to handle nested JSON responses ([#6209](#6209)) ([ffc0d7a](ffc0d7a)) * getting occasional unauthenticated errors from googlepubsub ([#6228](#6228)) ([cc39306](cc39306)) * handle snowpipe service restarts in destination polling logic ([#6236](#6236)) ([b76bc7f](b76bc7f)) * handling empty schema for table level schemas ([#6233](#6233)) ([cc39306](cc39306)) * histogram buckets for schema snapshots ([#6234](#6234)) ([cc39306](cc39306)) * warehouse source empty jobs ([#6204](#6204)) ([42f5ae4](42f5ae4)) ### Miscellaneous * bump the go-dependencies group with 12 updates ([#6189](#6189)) ([e6e2bcd](e6e2bcd)) * enforcing non-sugared logger ([#6066](#6066)) ([b24ded8](b24ded8)) * force new MTU metrics from 1st September 2025 onwards ([#6227](#6227)) ([154d2c3](154d2c3)) * implement configurable deduplication mirror mode ([#6224](#6224)) ([c97ad7a](c97ad7a)) * refactor Google Pub/Sub to add retry logic for auth errors ([#6229](#6229)) ([cc39306](cc39306)) * remove enableV2NotifierJob flag support ([#6196](#6196)) ([8be54bf](8be54bf)) * remove event blocking flag ([#6240](#6240)) ([e668e14](e668e14)) * remove queryWithUploadId flag support for load files ([#6192](#6192)) ([e6e2bcd](e6e2bcd)) * revert "fix: snowpipe events getting duplicated if status API fails" ([#6211](#6211)) ([777b08e](777b08e)) * skip warehouse destinations from version deprecation error extraction ([#6226](#6226)) ([87c3320](87c3320)) * stop collecting errors in proc_error jobsdb ([#6232](#6232)) ([c600968](c600968)) * throttler should emit no warning if not enabled ([#6223](#6223)) ([0773168](0773168)) * update keydb dependency ([#6222](#6222)) ([d1d64bc](d1d64bc)) * use harbor to pull docker images ([#6210](#6210)) ([6c324cf](6c324cf)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add retry logic with exponential backoff to handle intermittent unauthenticated errors from Google Pub/Sub. This improves reliability by automatically retrying authentication failures up to 3 times with 100ms, 200ms, and 400ms delays.
Changes Made
Linear Ticket
https://linear.app/rudderstack/issue/RUD-2463/hey-subteams02aeql26ct-subteams03shj20350-pandampg-has
Security
The retry logic only handles authentication errors and doesn't expose any sensitive information. Non-authentication errors are immediately returned without retry to prevent potential security issues.