Repository navigation
fix(batchrouter): do not abort warehouse jobs on a zero failure timestamp - #7426
Merged
Merged
Conversation
…tamp
warehouseServiceFailedTime is a single field on the Handle, shared by every
destination of a destType, and the `else if isWarehouse` arm zeroes it on any
warehouse batch that is not a ping failure - including every successful one.
The abort check re-read that field after setting it, so a concurrent success
could zero it in between. time.Since(time.Time{}) is ~2000 years, which
exceeds any retry window, so the job was aborted with 410 on its first attempt
instead of being retried.
Capture the failure start under the same lock that sets it and check the local
copy, and never abort on a zero timestamp.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012YX6Cdjs6iKeJCtzm9udju
There were no tests for warehouseServiceFailedTime, warehouseServiceMaxRetryTime or updateJobStatus, which is how the zero-timestamp abort survived since #3248. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012YX6Cdjs6iKeJCtzm9udju
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7426 +/- ##
==========================================
+ Coverage 84.49% 84.96% +0.46%
==========================================
Files 622 622
Lines 62045 62048 +3
==========================================
+ Hits 52427 52720 +293
+ Misses 9615 9325 -290
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
saikumarrs
approved these changes
Sep 28, 2026
itsmihir
added a commit
that referenced
this pull request
Sep 29, 2026
# Description Syncing release v1.89.0 to main branch **WARNING: Do NOT rewrite git history and ALWAYS use a "Merge Commit" for merging!** **↓↓ Please review and edit commit overrides before merging ↓↓** BEGIN_COMMIT_OVERRIDE fix(batchrouter): do not abort warehouse jobs on a zero failure timestamp (#7426) END_COMMIT_OVERRIDE
This was referenced Oct 12, 2026
Merged
mihir20
pushed a commit
that referenced
this pull request
Oct 12, 2026
🤖 I have created a release *beep* *boop* --- ## [1.90.0-rc.1](v1.89.0...v1.90.0-rc.1) (2026-10-12) ### Features * **processor:** add source_out reporting metric ([#7435](#7435)) ([909fba9](909fba9)) * **processor:** allow disabling event schemas v2 per source ([#7429](#7429)) ([a8c12b2](a8c12b2)) * **processor:** report dest_transformer diff rows for multiplexing destination transformations ([#7446](#7446)) ([cd95c32](cd95c32)) * **processor:** report dest_transformer succeeded for destinations without a destination transformation ([#7445](#7445)) ([21f7e41](21f7e41)) * **processor:** report user_transformer succeeded for destinations without a user transformation ([#7440](#7440)) ([f424257](f424257)) * **router:** mask live events destination credentials ([#7460](#7460)) ([5fa5fe2](5fa5fe2)) * **warehouse:** add Microsoft Fabric destination ([#7441](#7441)) ([74940c2](74940c2)) ### Bug Fixes * **batchrouter:** do not abort warehouse jobs on a zero failure timestamp ([#7426](#7426)) ([506f6d5](506f6d5)) * **batchrouter:** recover snowpipe streaming channels for tables dropped externally ([#7434](#7434)) ([93cd81d](93cd81d)) * **destination:** encode Lytics bulk upload URL values ([#7433](#7433)) ([08e6937](08e6937)) * **destination:** retry bqstream transport failures ([#7464](#7464)) ([cd3dc3e](cd3dc3e)) * **warehouse:** cap deltalake validation schema describes ([#7444](#7444)) ([d119779](d119779)) * **warehouse:** keep snowflake copy credentials out of logs ([#7442](#7442)) ([f91747b](f91747b)) * **warehouse:** set explicit lineSep for deltalake csv copy ([#7455](#7455)) ([cc22d18](cc22d18)) ### Miscellaneous * migrate self-hosted arm64 docker build runners to gha-runner-scale-set ([#7425](#7425)) ([5cdffde](5cdffde)) * **processor:** retire the destination-filter reorder, dedup and gw_ingested reporting flags ([#7450](#7450)) ([1040511](1040511)) * pull openapi-generator through the ECR pull-through cache ([#7449](#7449)) ([6e9f920](6e9f920)) --- 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>
mihir20
pushed a commit
that referenced
this pull request
Oct 13, 2026
🤖 I have created a release *beep* *boop* --- ## [1.90.0](v1.89.0...v1.90.0) (2026-10-12) ### Features * **processor:** add source_out reporting metric ([#7435](#7435)) ([909fba9](909fba9)) * **processor:** allow disabling event schemas v2 per source ([#7429](#7429)) ([a8c12b2](a8c12b2)) * **processor:** report dest_transformer diff rows for multiplexing destination transformations ([#7446](#7446)) ([cd95c32](cd95c32)) * **processor:** report dest_transformer succeeded for destinations without a destination transformation ([#7445](#7445)) ([21f7e41](21f7e41)) * **processor:** report user_transformer succeeded for destinations without a user transformation ([#7440](#7440)) ([f424257](f424257)) * **router:** mask live events destination credentials ([#7460](#7460)) ([5fa5fe2](5fa5fe2)) * **warehouse:** add Microsoft Fabric destination ([#7441](#7441)) ([74940c2](74940c2)) ### Bug Fixes * **batchrouter:** do not abort warehouse jobs on a zero failure timestamp ([#7426](#7426)) ([506f6d5](506f6d5)) * **batchrouter:** recover snowpipe streaming channels for tables dropped externally ([#7434](#7434)) ([93cd81d](93cd81d)) * **destination:** encode Lytics bulk upload URL values ([#7433](#7433)) ([08e6937](08e6937)) * **destination:** retry bqstream transport failures ([#7464](#7464)) ([cd3dc3e](cd3dc3e)) * **warehouse:** cap deltalake validation schema describes ([#7444](#7444)) ([d119779](d119779)) * **warehouse:** keep snowflake copy credentials out of logs ([#7442](#7442)) ([f91747b](f91747b)) * **warehouse:** set explicit lineSep for deltalake csv copy ([#7455](#7455)) ([cc22d18](cc22d18)) ### Miscellaneous * migrate self-hosted arm64 docker build runners to gha-runner-scale-set ([#7425](#7425)) ([5cdffde](5cdffde)) * **processor:** retire the destination-filter reorder, dedup and gw_ingested reporting flags ([#7450](#7450)) ([1040511](1040511)) * pull openapi-generator through the ECR pull-through cache ([#7449](#7449)) ([6e9f920](6e9f920)) --- 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>
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.
Linear: INT-7231
Problem
warehouseServiceFailedTimegates whether jobs waiting on a failing warehouse service are retried or aborted with410. It is meant to give themBatchRouter.warehouseServiceMaxRetryTime(default 3h) before giving up. In practice it can abort them on their first attempt.Three things combine (
router/batchrouter/handle.go):Factory.New(destType)creates oneHandleper destType, so a singlewarehouseServiceFailedTimedescribes "is the warehouse service failing" for every destination of that destType in the process.else if isWarehousearm resets it totime.Time{}on every warehouse batch that is not a ping failure — including all the successful ones.updateJobStatusruns underBatchRouter.Limiter.upload.limit(default 200) concurrent goroutines on the sameHandle, so a concurrent success can zero the field between the write and the read.time.Since(time.Time{})is roughly 2,025 years, which exceeds any retry window, so the guard aborts unconditionally when it reads a zero.Production impact
entusmtprod/enterprise-rudder, 2026-09-23. A workspace migration editedWarehouse.degradedWorkspaceIDsthree times in 40 minutes. That key is read with the non-reloadable getter and the operator setsshutdownOnNonReloadableConfigChange: true, so the shared warehouse service restarted three times.pingWarehousePOSTs to/v1/processfailed during the restarts:500, retried, and delivered once the service returned — the whole cycle took about two minutes.410aborts. The sampled reporting row showsfirstAttemptedAt 2026-09-23T20:02:37.175Z, and the abort counter reads its final value by20:03:00Z— aborted 23 seconds after the job's first attempt, on attempt one.Neither retry policy can produce that.
retryLimitReachedneedsAttemptNum >= 128andtime.Since(firstAttemptedAt) > retryTimeWindow(24h on this cluster), and it is gated on!notifyWarehouseErrso it was never evaluated. The warehouse branch needs 3 hours. The only way to get 23 seconds is a comparison against the zero time.During the failing two-minute window
generate_staging_filesshows ~2,576 batch completions inentusmtprod— roughly 20 calls per second into this code path, most of them successes zeroing the field.Change
Capture the failure start under the same lock that sets it, and check that local copy:
and move the decision into a named method that refuses to abort on a zero:
The zero check is deliberately belt-and-braces: with the capture in place the guard should never see a zero, but if it ever does the safe direction is to retry, not to discard customer data.
Verification
The test fails without the fix — removing the
IsZeroguard produces:go build ./router/...andgo vet ./router/batchrouter/are clean.There were no existing tests for
warehouseServiceFailedTime,warehouseServiceMaxRetryTimeorupdateJobStatus, which is how this survived since #3248 (May 2023).Deliberately not in this PR
The field is still shared across every destination of a destType, so one destination's success still clears the failure clock for the others. That means the 3-hour window can struggle to accumulate on a busy shared namespace and the guard will under-abort. That is the safe direction, and fixing it properly means keying the state by destination — a larger change worth doing separately.
Not proven
The exact interleaving for those four destinations is deduced, not observed: nothing logs or counts the reset. It is the only remaining mechanism after ruling out
retryLimitReached(arithmetically impossible at 23s), a configuration override (no override in the operator or devops repos), the drainer path (emitsdrained_events, which is absent for these destinations), anddegradedWorkspaceIDs(only filters config; the degraded workspace itself had zero aborts, and none of the four was ever on the list).🤖 Generated with Claude Code
https://claude.ai/code/session_012YX6Cdjs6iKeJCtzm9udju