Repository navigation
fix: mid-run pod deaths under concurrent test runs - #7212
Conversation
…ding for runIDLength, readinessPollInterval, and deleteTimeout 🔒 Scanned for secrets using gitleaks 8.28.0
…rd time and readiness wait metrics 🔒 Scanned for secrets using gitleaks 8.28.0
…t handling 🔒 Scanned for secrets using gitleaks 8.28.0
🔒 Scanned for secrets using gitleaks 8.28.0
…nt stability 🔒 Scanned for secrets using gitleaks 8.28.0
fe13593 to
3945149
Compare
…rtions 🔒 Scanned for secrets using gitleaks 8.28.0
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/1.81.x #7212 +/- ##
=================================================
Coverage ? 79.78%
=================================================
Files ? 596
Lines ? 66477
Branches ? 0
=================================================
Hits ? 53038
Misses ? 10319
Partials ? 3120 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| route := "static" | ||
| if isExecutionOp { | ||
| if s.isProdRouted(req.WorkspaceId) { | ||
| route = "production" |
There was a problem hiding this comment.
Can we use constants for these?
| defer cancel() | ||
|
|
||
| ticker := time.NewTicker(readinessPollInterval) | ||
| ticker := time.NewTicker(d.config.readinessPollInterval.Load()) |
There was a problem hiding this comment.
If I'm not mistaken tickers panic with anything <= 0, bringing down the whole processor. Beware of feeding reloadable vars directly here.
| timedForward := func(ctx context.Context, baseURL string) (int, []byte, error) { | ||
| execStart := time.Now() | ||
| statusCode, body, err := forward(ctx, baseURL, req.WorkspaceId, req.Payload) | ||
| s.stat.NewTaggedStat("processor_pyt_request_handle_time", stats.TimerType, tags).Since(execStart) |
There was a problem hiding this comment.
Wouldn't we emit this even on failures like readiness timeouts or deployer failures? We might want to add a success label to tell them apart.
| // from starting on an out-of-range value. | ||
| func runIDLength(conf *config.Config) int { | ||
| const prefixLen = len("pyt-test-") | ||
| length := conf.GetIntVar(8, 1, "Processor.pytDeployer.pytTestRunIDLength") |
There was a problem hiding this comment.
I wonder if we need this configurable at all. A configured value of 1 to 3 is accepted silently (~32–~32³ possible names). Under concurrent load two different runs can then generate the same name and we would get AlreadyExists (which is assumed as "our own retry succeeded").
This means that both runs share one Deployment/Service. Any thoughts?
There was a problem hiding this comment.
I have kept the default value of 8, Ideally we should not see collisions on 8 but just to be on a safer side I made this configurable.
There was a problem hiding this comment.
If you still want it to be configurable then let's make sure it is at least 8 and no less? Wdyt? The problem is misconfiguration here. If you pass 1 somehow then you get a nasty silent bug.
🔒 Scanned for secrets using gitleaks 8.28.0
fracasula
left a comment
There was a problem hiding this comment.
Looks mostly good, left another comment on the metrics because I think that it could cause confusion and make things hard to understand when looking at the dashboards.
| // a forward error, or success alike. It never changes the response | ||
| // returned to the caller; a failed delete is only logged. | ||
| defer d.delete(ctx, name) | ||
| defer d.delete(ctx, name, workspaceID) |
There was a problem hiding this comment.
Just move this up and you can delete the repetition in the above if.
| err := d.waitReady(ctx, name) | ||
| // Emitted on both outcomes: the success:false series makes readiness | ||
| // timeouts visible and clusters at the configured readiness timeout. | ||
| d.stat.NewTaggedStat("processor_pyt_readiness_wait_time", stats.TimerType, stats.Tags{ |
There was a problem hiding this comment.
On a Deployment/Service Create failure (ephemeral route), RunOnEphemeral returns before readyStart, so processor_pyt_readiness_wait_time is never emitted, and the forward closure is never invoked so processor_pyt_request_handle_time isn't either.
The real problem though it's that basically if that were to happen, the single
metric for that failed RPC is processor_pyt_forward_rpc_time. This means that there would be no way to tell it apart from a slow success.
🔒 Scanned for secrets using gitleaks 8.28.0
🤖 I have created a release *beep* *boop* --- ## [1.81.2](v1.81.1...v1.81.2) (2026-07-27) ### Bug Fixes * mid-run pod deaths under concurrent test runs ([#7212](#7212)) ([cf89256](cf89256)) --- 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>
# Description Syncing patch release v1.81.2 to main branch **↓↓ Please review and edit commit overrides before merging ↓↓** BEGIN_COMMIT_OVERRIDE fix: mid-run pod deaths under concurrent test runs (#7212) END_COMMIT_OVERRIDE --------- Co-authored-by: Mahesh Kutty <[email protected]> Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com> Co-authored-by: Mihir Gandhi <[email protected]>
# Description Syncing patch release v1.81.3 to main branch **↓↓ Please review and edit commit overrides before merging ↓↓** BEGIN_COMMIT_OVERRIDE fix: use correct JSON tag for adjustedConversionTime in bing-ads (#7204) fix: mid-run pod deaths under concurrent test runs (#7212) fix: apply configured client QPS and Burst settings in restConfig (#7220) END_COMMIT_OVERRIDE --------- Co-authored-by: Mahesh Kutty <[email protected]> Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com> Co-authored-by: Mihir Gandhi <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [1.82.0-rc.1](v1.81.0...v1.82.0-rc.1) (2026-08-03) ### Features * **processor:** fork event processing for configured isolated destinations ([#7207](#7207)) ([6eb91b4](6eb91b4)) * **processor:** isolated destination processing pipeline ([#7202](#7202)) ([a684641](a684641)) * **router:** detect and classify transformer-proxy contract breaches (INT-6839) ([#7184](#7184)) ([c7a15a8](c7a15a8)) * **router:** gate 296 delivered-with-warning behind per-workspace rollout ([#7217](#7217)) ([1d772a1](1d772a1)) ### Bug Fixes * apply configured client QPS and Burst settings in restConfig ([#7220](#7220)) ([762bc06](762bc06)) * gcs manager allows non-service account credentials and warehouse ssl keys can escape their containing path ([#7227](#7227)) ([3e126b2](3e126b2)) * mid-run pod deaths under concurrent test runs ([#7212](#7212)) ([5279b64](5279b64)) * normalize null BingAds offline conversion fields ([#7236](#7236)) ([678f130](678f130)) * use correct JSON tag for adjustedConversionTime in bing-ads ([#7204](#7204)) ([50df0f7](50df0f7)) ### Miscellaneous * add new readme logo ([#7200](#7200)) ([ab86afd](ab86afd)) * **deps:** bump the go-deps group across 1 directory with 32 updates ([#7199](#7199)) ([0eaa833](0eaa833)) * **jobsdb:** graceful shutdown of addNewDSLoop and refreshDSListLoop ([#7210](#7210)) ([78e104c](78e104c)) * remove archiveInPreProcess processor toggle ([#7205](#7205)) ([f471b1d](f471b1d)) --- 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.82.0](v1.81.0...v1.82.0) (2026-08-03) ### Features * **processor:** fork event processing for configured isolated destinations ([#7207](#7207)) ([6eb91b4](6eb91b4)) * **processor:** isolated destination processing pipeline ([#7202](#7202)) ([a684641](a684641)) * **router:** detect and classify transformer-proxy contract breaches (INT-6839) ([#7184](#7184)) ([c7a15a8](c7a15a8)) * **router:** gate 296 delivered-with-warning behind per-workspace rollout ([#7217](#7217)) ([1d772a1](1d772a1)) ### Bug Fixes * apply configured client QPS and Burst settings in restConfig ([#7220](#7220)) ([762bc06](762bc06)) * gcs manager allows non-service account credentials and warehouse ssl keys can escape their containing path ([#7227](#7227)) ([3e126b2](3e126b2)) * mid-run pod deaths under concurrent test runs ([#7212](#7212)) ([5279b64](5279b64)) * normalize null BingAds offline conversion fields ([#7236](#7236)) ([678f130](678f130)) * use correct JSON tag for adjustedConversionTime in bing-ads ([#7204](#7204)) ([50df0f7](50df0f7)) ### Miscellaneous * add new readme logo ([#7200](#7200)) ([ab86afd](ab86afd)) * **deps:** bump the go-deps group across 1 directory with 32 updates ([#7199](#7199)) ([0eaa833](0eaa833)) * **jobsdb:** graceful shutdown of addNewDSLoop and refreshDSListLoop ([#7210](#7210)) ([78e104c](78e104c)) * remove archiveInPreProcess processor toggle ([#7205](#7205)) ([f471b1d](f471b1d)) --- 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>
Description
Fixes a mid-run pod-death bug in concurrent ephemeral pyt test runs, adds per-operation observability to the processor's CP-facing
ForwardRPC (Python transformation tests), and makes the ephemeral pytdeployer's timing knobs configurable.
Bug fix: mid-run pod deaths under concurrent test runs
Concurrent ephemeral test runs for the same workspace carried identical label sets, so every run's Service selected every run's pods. A request forwarded through run A's Service could land on run B's
pod — which run B deletes the moment it finishes, killing A's request mid-flight ("Subprocess died (exit code -15)").
Each run's Deployment selector, pod template labels, and Service selector now also carry a per-run name label (
rudderstack.com/run= the uniquepyt-test-<suffix>name), making concurrent runslabel-disjoint: each Service selects only its own run's pods. Covered by a test asserting two same-workspace runs produce Services that select their own pods and not each other's.
New metrics
processor_pyt_forward_rpc_timeop,route,workspaceIdForwardRPC: deployment setup + readiness wait + requestprocessor_pyt_request_handle_timeop,route,workspaceIdprocessor_pyt_readiness_wait_timeworkspaceId,successprocessor_pyt_cleanup_failure_countworkspaceIdroutedistinguishes the three forwarding paths:ephemeral(fresh pyt deployment),production(config-flagged workspaces),static(AST ops).forward_rpc_time − request_handle_timetells you how much of a slow test was setup vs. actual execution; the readiness-wait timer breaks the setup portion down further.success:falsereadiness samples cluster at the configured timeout, making timeouts visible.processor_pyt_request_handle_timeis only emitted when a request was actually made — a deployer failure before forwarding records no sample. Rejected requests (invalid op/workspaceId) emit nothing.runner/buckets.go.user_transformer.forwardTestnow carry apathtag so retries can be attributed per pyt endpoint.New config keys (
Processor.pytDeployer.*)pytTestReadinessPollInterval250mspytTestDeleteTimeout15spytTestRunIDLength8pyt-test-<suffix>a valid DNS-1035 labelImplementation notes
pytdeployer.Newnow takesstats.Stats;cpservice.Serviceretains the stats handle it already received.Forwardshare a singletimedForwardclosure that emits the request timer itself, so no forward ⇒ no sample, with no extra bookkeeping.Linear Ticket
Security