Repository navigation
fix: abort non-retryable Klaviyo upload errors instead of retrying - #7085
shekhar-rudder merged 3 commits into
Conversation
be160f6 to
97b3ba5
Compare
97b3ba5 to
e22441f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7085 +/- ##
==========================================
+ Coverage 79.88% 79.92% +0.04%
==========================================
Files 583 583
Lines 65088 65099 +11
==========================================
+ Hits 51993 52031 +38
+ Misses 10001 9970 -31
- Partials 3094 3098 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…NT-6539) Klaviyo 4xx errors (except 429) were incorrectly marked as retryable, causing invalid profiles to retry indefinitely, fill batch slots, and push valid events into "prescribed limit" overflow until they were permanently aborted. Now 4xx (except 429) errors are routed to AbortJobIDs, while 429/5xx and network errors remain in FailedJobIDs for retry. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
e22441f to
d5ea037
Compare
| assert.NotEmpty(t, output.ImportingJobIDs) | ||
| assert.Equal(t, common.AsyncUploadOutput{ | ||
| ImportingJobIDs: []int64{1}, | ||
| ImportingParameters: output.ImportingParameters, |
There was a problem hiding this comment.
This doesn't feel correct, we are adding the expected output here to match the actual output, can we verify individual fields?
There was a problem hiding this comment.
Kept the single struct comparison for a concise assertion, but the ImportingParameters is verified separately in a dedicated require.Equal assertion right after. The self-reference in the struct is only for ImportingParameters since it's a marshaled JSON blob validated independently.
There was a problem hiding this comment.
Maybe we can do something like this, comparing default values does not give much value. Also, if we add new properties to the AsyncUploadOutput, all these tests would break.
require.Equal(t, 1, output.ImportingCount)
require.Equal(t, []int64{1}, output.ImportingJobIDs)
require.Equal(t, destination.ID, output.DestinationID)
require.Equal(t, `{"importId":"importId1","importCount":0}`, string(output.ImportingParameters))
There was a problem hiding this comment.
Also, if we add new properties to the AsyncUploadOutput, all these tests would break.
If we add a new field, I think it's fine if the tests fail initially. We should update the existing tests to verify that the new field is being populated correctly.
There was a problem hiding this comment.
IMO, this would require all tests to be updated, which is not needed. The same goes for removing something as well.
There was a problem hiding this comment.
IMO, this would require all tests to be updated, which is not needed.
Wouldn't it be preferable to ensure the new field is being set correctly in the existing tests as well? My guess is that we might have caught missing FailedReason if we were asserting the whole response. Also the output here is Upload method signature. Since that is part of interface, it is less likely to change.
- Add AbortCount and ImportingCount to Upload return value - Switch test assertions from assert to require for struct comparisons - Update expected test counts to reflect new AbortCount/ImportingCount fields Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [1.77.2](v1.77.1...v1.77.2) (2026-06-16) ### Bug Fixes * abort non-retryable Klaviyo upload errors instead of retrying ([#7085](#7085)) ([a31d6e5](a31d6e5)) --- 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: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
BEGIN_COMMIT_OVERRIDE fix: abort non-retryable Klaviyo upload errors instead of retrying (#7085) END_COMMIT_OVERRIDE
🤖 I have created a release *beep* *boop* --- ## [1.78.0-rc.1](v1.77.0...v1.78.0-rc.1) (2026-06-22) ### Features * add and register bq stream v2 async destination manager ([#7057](#7057)) ([787b7ac](787b7ac)) * add BQSTREAM_V2 destination type and bqstreamv2 building blocks ([#7056](#7056)) ([02e84e5](02e84e5)) * **batchrouter:** raise getImportingJobs max iterations and remove payload size limit ([#7076](#7076)) ([15707f6](15707f6)) * **gateway:** throttling support for internal batch endpoint ([#7055](#7055)) ([6b6ba65](6b6ba65)) * **jobsdb:** introduce compaction min ds age ([#7077](#7077)) ([4d6d97a](4d6d97a)) * **processor:** new intermediate jobsdb ([#7048](#7048)) ([dfef1f1](dfef1f1)) ### Bug Fixes * abort non-retryable Klaviyo upload errors instead of retrying ([#7085](#7085)) ([4c3e4f1](4c3e4f1)) * **batchrouter:** correlate poll results by externalId instead of whole-row hash ([09326d2](09326d2)) * **batchrouter:** report real status code and sample event for drained jobs ([#7104](#7104)) ([d3fab82](d3fab82)) * internal endpoints enabled in open source version of rudder-server ([#7075](#7075)) ([dc071cd](dc071cd)) * **jobsdb:** get jobs lateral join against the v_last view ([#7105](#7105)) ([853d14c](853d14c)) * klaviyo upload partial failures ([#7107](#7107)) ([37e79e9](37e79e9)) * **router:** shared barrier causing illegal job sequence errors ([#7101](#7101)) ([b5435ba](b5435ba)) ### Miscellaneous * add BQSTREAM_V2 integration tests ([#7058](#7058)) ([478e217](478e217)) * add rudderai announcement ([#7046](#7046)) ([ff02fe8](ff02fe8)) * bump codecov-action to 7.0.0 ([#7070](#7070)) ([31f0623](31f0623)) * cleanup embedded warehouse transformations ([#7072](#7072)) ([31f0623](31f0623)) * **deps:** bump actions/checkout from 6.0.2 to 6.0.3 ([#7084](#7084)) ([745d5ab](745d5ab)) * **deps:** bump aws-actions/configure-aws-credentials from 6.1.2 to 6.2.0 ([#7081](#7081)) ([19251cd](19251cd)) * **jobsdb:** refactoring and cleanup ([#7043](#7043)) ([2e4ea92](2e4ea92)) * remove legacy warehouse endpoints ([#7090](#7090)) ([6f85153](6f85153)) * rename bqstream all events ([#7088](#7088)) ([4d9ad19](4d9ad19)) * **router:** rename experimental buffer size calculator to dynamic ([#7103](#7103)) ([52896cd](52896cd)) * support using the full event schema key as pulsar ordering key ([#7086](#7086)) ([ff50611](ff50611)) --- 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: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [1.78.0](v1.77.0...v1.78.0) (2026-06-22) ### Features * add and register bq stream v2 async destination manager ([#7057](#7057)) ([787b7ac](787b7ac)) * add BQSTREAM_V2 destination type and bqstreamv2 building blocks ([#7056](#7056)) ([02e84e5](02e84e5)) * **batchrouter:** raise getImportingJobs max iterations and remove payload size limit ([#7076](#7076)) ([15707f6](15707f6)) * **gateway:** throttling support for internal batch endpoint ([#7055](#7055)) ([6b6ba65](6b6ba65)) * **jobsdb:** introduce compaction min ds age ([#7077](#7077)) ([4d6d97a](4d6d97a)) * **processor:** new intermediate jobsdb ([#7048](#7048)) ([dfef1f1](dfef1f1)) ### Bug Fixes * abort non-retryable Klaviyo upload errors instead of retrying ([#7085](#7085)) ([4c3e4f1](4c3e4f1)) * **batchrouter:** correlate poll results by externalId instead of whole-row hash ([09326d2](09326d2)) * **batchrouter:** report real status code and sample event for drained jobs ([#7104](#7104)) ([d3fab82](d3fab82)) * internal endpoints enabled in open source version of rudder-server ([#7075](#7075)) ([dc071cd](dc071cd)) * **jobsdb:** get jobs lateral join against the v_last view ([#7105](#7105)) ([853d14c](853d14c)) * klaviyo upload partial failures ([#7107](#7107)) ([37e79e9](37e79e9)) * **router:** shared barrier causing illegal job sequence errors ([#7101](#7101)) ([b5435ba](b5435ba)) ### Miscellaneous * add BQSTREAM_V2 integration tests ([#7058](#7058)) ([478e217](478e217)) * add rudderai announcement ([#7046](#7046)) ([ff02fe8](ff02fe8)) * bump codecov-action to 7.0.0 ([#7070](#7070)) ([31f0623](31f0623)) * cleanup embedded warehouse transformations ([#7072](#7072)) ([31f0623](31f0623)) * **deps:** bump actions/checkout from 6.0.2 to 6.0.3 ([#7084](#7084)) ([745d5ab](745d5ab)) * **deps:** bump aws-actions/configure-aws-credentials from 6.1.2 to 6.2.0 ([#7081](#7081)) ([19251cd](19251cd)) * **jobsdb:** refactoring and cleanup ([#7043](#7043)) ([2e4ea92](2e4ea92)) * remove legacy warehouse endpoints ([#7090](#7090)) ([6f85153](6f85153)) * rename bqstream all events ([#7088](#7088)) ([4d9ad19](4d9ad19)) * **router:** rename experimental buffer size calculator to dynamic ([#7103](#7103)) ([52896cd](52896cd)) * support using the full event schema key as pulsar ordering key ([#7086](#7086)) ([ff50611](ff50611)) --- 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: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
Summary
FailedJobIDs), causing invalid profiles to retry indefinitely, fill batch slots, and push valid events into "prescribed limit" overflow until they were permanently abortedUploadProfilesnow captures the HTTP status code from Klaviyo's responseUploadroutes errors by retryability: 4xx (except 429) →AbortJobIDs(terminal), 429/5xx/network errors →FailedJobIDs(retryable)FailedReasonis now populated in the upload output for better observabilityTest plan
TestUpload/Successful_Upload— all jobs import successfully, no failuresTestUpload/Unsuccessful_Upload— nil response (network error) → jobs retried withFailedReasonTestUpload/UploadThreeChunksWithMixedFailures— chunk 1 gets 429 (retried), chunk 2 gets 400 (aborted), chunk 3 succeeds — validates both paths in single testLinear ticket
INT-6539
🤖 Generated with Claude Code