Skip to content

fix: snowpipe struck scenarios - #6895

Merged
achettyiitr merged 11 commits into
masterfrom
chore.snowpipe-struck
Apr 27, 2026
Merged

achettyiitr merged 11 commits into
masterfrom
chore.snowpipe-struck

Conversation

@achettyiitr

@achettyiitr achettyiitr commented Apr 20, 2026 •

Copy link
Copy Markdown
Member

🔒 Scanned for secrets using gitleaks 8.29.1

Description

Summary

  • Improved Snowpipe Streaming resilience by decoupling Upload and Poll from caller cancellation and handling polling with an internal background context.
  • Added stuck-pipeline handling in Poll: in-progress imports are now marked failed after threshold and included in failed job parameters.
  • Refactored processPollImportInfos to return in-progress import entries directly, and tightened isInProgress by returning an explicit error for unexpected polling states.
  • Added early context-cancellation guards in pollAsyncStatus and asyncUploadWorker loops to stop cleanly during shutdown.

Linear Ticket

  • Resolves INT-6237, INT-6238, INT-6249.

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of context cancelled, don't Upload and Poll.

@achettyiitr achettyiitr Apr 20, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting a timeout for the DB connection. Also, keeping timeout for the HTTP client (60s). Therefore, getting rid of context for Upload and Poll.

@codecov

codecov Bot commented Apr 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.21053% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.15%. Comparing base (c1e27d0) to head (6eb1d97).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
router/batchrouter/handle_async.go 0.00% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6895      +/-   ##
==========================================
+ Coverage   79.78%   80.15%   +0.37%     
==========================================
  Files         565      565              
  Lines       63355    63372      +17     
==========================================
+ Hits        50547    50797     +250     
+ Misses       9836     9590     -246     
- Partials     2972     2985      +13     

☔ 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.

achettyiitr and others added 2 commits April 22, 2026 10:13
🔒 Scanned for secrets using gitleaks 8.29.1

# Description

Drained jobs were being aborted without the drain error code in async
retry-limit paths, and worker processed-event metrics were referencing
the wrong status collection. This could under-report or misclassify
drained-event metrics.
- Set `ErrorCode = routerutils.DRAIN_ERROR_CODE` when failed async jobs
are transitioned to `aborted` in:
  - `prepareJobStatusList`
  - `setMultipleJobStatus`
- Fix worker metrics reporting to use `drainList` (not `statusList`)
when emitting `pipeline_processed_events` for drained jobs.

## Linear Ticket

- Resolves INT-5883

## Security

- [ ] The code changed/added as part of this pull request won't create
any security issues with how the software is being used.
🤖 I have created a release *beep* *boop*
---


##
[1.73.1](v1.73.0...v1.73.1)
(2026-04-22)


### Bug Fixes

* batch router drained events metrics
([#6898](#6898))
([ae9f0c0](ae9f0c0))

---
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>
🔒 Scanned for secrets using gitleaks 8.29.1
@achettyiitr
achettyiitr force-pushed the chore.snowpipe-struck branch from f0ebf47 to 66a7c2d Compare April 22, 2026 20:44
🔒 Scanned for secrets using gitleaks 8.29.1
🔒 Scanned for secrets using gitleaks 8.29.1
🔒 Scanned for secrets using gitleaks 8.29.1
🔒 Scanned for secrets using gitleaks 8.29.1
ItsSudip and others added 3 commits April 23, 2026 16:25
🔒 Scanned for secrets using gitleaks 8.28.0

# Description

Fixes a 403 from Salesforce Edge on Hyperforce-hosted orgs when calling
the Bulk API through the Salesforce Bulk Upload destination.

# Root cause
The Salesforce OAuth augmenter at
[augmenter.go](vscode-webview://04v3039e9pe19rdu9vplb86dddgdd2egpmj5pljj7ie5prn9pj2t/router/batchrouter/asyncdestinationmanager/salesforce-bulk-upload/augmenter/augmenter.go)
was mutating `r.URL.Host` to the org's instance URL but leaving `r.Host`
pointing at the placeholder base host. `http.NewRequest` snapshots
`Host` from the URL string at construction time, so mutating `URL.Host`
alone leaves the outgoing `HTTP` `Host: header` stale. The transport
then:

- Opened the TCP connection to <customer>.my.salesforce.com (correct,
via URL.Host)
- Sent TLS SNI for <customer>.my.salesforce.com (correct)
- …but wrote Host: default.salesforce.com on the HTTP request line
(wrong)
Classic Salesforce pods tolerate the mismatched Host header and route
based on session token. Hyperforce pods (aws-prod*-*) validate the Host
header at the edge layer and reject the mismatched request with a 403
HTML error page from "Salesforce Edge" before it ever reaches the org's
API.

This explains why we saw:

✅ Our own Salesforce account (classic pod) succeeded on the same code
path
❌ Customer on Hyperforce (aws-prod21-useast2) hit 403 repeatedly with
edge trace IDs
❌ No INVALID_SESSION_ID JSON error — the request never reached the API
layer
❌ Customer's IP restriction / Connected App changes had no effect — it
was never an IP or auth issue

## Linear Ticket


https://linear.app/rudderstack/issue/INT-6254/debug-fullscript-salesforce-bulk-api-edge-error

## Security

- [ ] The code changed/added as part of this pull request won't create
any security issues with how the software is being used.
🤖 I have created a release *beep* *boop*
---


##
[1.73.2](v1.73.1...v1.73.2)
(2026-04-23)


### Bug Fixes

* add correct host for salesforceBU destination
([#6906](#6906))
([e73a82c](e73a82c))

---
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>
@achettyiitr
achettyiitr changed the base branch from release/1.73.x to master April 27, 2026 08:34
@achettyiitr achettyiitr changed the title chore: snowpipe struck fix: snowpipe struck scnearios Apr 27, 2026
@achettyiitr achettyiitr changed the title fix: snowpipe struck scnearios fix: snowpipe struck scenarios Apr 27, 2026
🔒 Scanned for secrets using gitleaks 8.29.1
@achettyiitr
achettyiitr force-pushed the chore.snowpipe-struck branch from 9e0e121 to 6eb1d97 Compare April 27, 2026 08:59
@achettyiitr
achettyiitr enabled auto-merge (squash) April 27, 2026 08:59
@achettyiitr
achettyiitr merged commit 35b07a8 into master Apr 27, 2026
70 checks passed
@achettyiitr
achettyiitr deleted the chore.snowpipe-struck branch April 27, 2026 09:28
This was referenced Apr 27, 2026
mihir20 pushed a commit that referenced this pull request Apr 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.74.0-rc.1](v1.73.0...v1.74.0-rc.1)
(2026-04-27)


### Features

* add configurable batch size for bulk inserting failed rsources records
([#6873](#6873))
([d8f6ea0](d8f6ea0))
* add native deletion support for identity removal in gzip files
([#6896](#6896))
([c1e27d0](c1e27d0))
* deep job pickups when no results cache is cold
([#6850](#6850))
([03e9d88](03e9d88))
* **jobsdb:** improve migration compaction
([#6844](#6844))
([b7f2b9f](b7f2b9f))


### Bug Fixes

* add correct host for salesforceBU destination
([#6906](#6906))
([2430cb4](2430cb4))
* batch router drained events metrics
([#6898](#6898))
([c5b2927](c5b2927))
* build action failing
([#6899](#6899))
([691a812](691a812))
* snowpipe struck scenarios
([#6895](#6895))
([35b07a8](35b07a8))
* use tid instead of vid
([#6908](#6908))
([954dcf7](954dcf7))


### Miscellaneous

* avoid marshalling proc error job payloads
([#6872](#6872))
([145826b](145826b))
* bump build-scan-push-action from v2.1.0 to v2.2.0
([#6903](#6903))
([e917f9b](e917f9b))
* contract tests for dns regressions and overrides
([#6864](#6864))
([b105678](b105678))
* pin and bump action refs (SEC-171)
([#6863](#6863))
([8089953](8089953))
* pytransformer pooling contract tests
([#6883](#6883))
([0530c8c](0530c8c))
* scope workflow permissions to least privilege (SEC-167)
([#6911](#6911))
([5600dbe](5600dbe))
* update Slack notification method in scheduled release workflow
([#6879](#6879))
([3b67dcb](3b67dcb))
* **vuln:** zizmor --fix=all findings (SEC-199)
([#6905](#6905))
([d8cc34f](d8cc34f))

---
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 Apr 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.74.0](v1.73.0...v1.74.0)
(2026-04-27)


### Features

* add configurable batch size for bulk inserting failed rsources records
([#6873](#6873))
([d8f6ea0](d8f6ea0))
* add native deletion support for identity removal in gzip files
([#6896](#6896))
([c1e27d0](c1e27d0))
* deep job pickups when no results cache is cold
([#6850](#6850))
([03e9d88](03e9d88))
* **jobsdb:** improve migration compaction
([#6844](#6844))
([b7f2b9f](b7f2b9f))


### Bug Fixes

* add correct host for salesforceBU destination
([#6906](#6906))
([2430cb4](2430cb4))
* batch router drained events metrics
([#6898](#6898))
([c5b2927](c5b2927))
* build action failing
([#6899](#6899))
([691a812](691a812))
* snowpipe struck scenarios
([#6895](#6895))
([35b07a8](35b07a8))
* use tid instead of vid
([#6908](#6908))
([954dcf7](954dcf7))


### Miscellaneous

* avoid marshalling proc error job payloads
([#6872](#6872))
([145826b](145826b))
* bump build-scan-push-action from v2.1.0 to v2.2.0
([#6903](#6903))
([e917f9b](e917f9b))
* contract tests for dns regressions and overrides
([#6864](#6864))
([b105678](b105678))
* pin and bump action refs (SEC-171)
([#6863](#6863))
([8089953](8089953))
* pytransformer pooling contract tests
([#6883](#6883))
([0530c8c](0530c8c))
* scope workflow permissions to least privilege (SEC-167)
([#6911](#6911))
([5600dbe](5600dbe))
* update Slack notification method in scheduled release workflow
([#6879](#6879))
([3b67dcb](3b67dcb))
* **vuln:** zizmor --fix=all findings (SEC-199)
([#6905](#6905))
([d8cc34f](d8cc34f))

---
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants