Skip to content

feat(router): delivery throttler - #6225

Merged
atzoum merged 4 commits into
masterfrom
feat.deliveryThrottler
Aug 25, 2025
Merged

atzoum merged 4 commits into
masterfrom
feat.deliveryThrottler

Conversation

@atzoum

@atzoum atzoum commented Aug 12, 2025 •

Copy link
Copy Markdown
Contributor

Description

Introducing a new layer of throttling in router additional to the existing pickup-level throttling, dubbed delivery throttling:

  • Delivery throttling can be enabled at a destination endpoint level.
  • Delivery throttling will delay the request in order to respect the configured throttling rates.
  • Delivery throttling configuration is controlled through the endpointLabel field of each transformed job.
  • We are not using the actual endpoint to avoid cardinality issues, e.g. different eu vs us endpoints or endpoints having various different query & path params.
  • In a typical scenario, we will be using the delivery throttler for endpoints that have low rate limits (e.g. <100 rps) and we will be leveraging a distributed throttling algorithm, so that we respect throttling limits across multiple pods.

Delivery Throttling Implementation:

  • Added a new delivery throttler mechanism to the router, allowing rate-limited event delivery to destination endpoints based on configurable limits and time windows. This includes support for a new EndpointLabel field in PostParametersT and relevant configuration keys. [1] [2] [3]

Integration Testing:

  • Introduced an integration test in router/delivery_throttler_test.go that verifies the router respects delivery rate limits for webhook events, including burst handling and timing tolerances.
  • Added a test configuration template file router/testdata/deliveryThrottlerTestTemplate.json to support the integration test setup.

Throttler Factory Refactor:

  • Refactored the throttler factory interface and usage to distinguish between pickup and delivery throttlers, updating method names and call sites for clarity and correctness. [1] [2] [3]

Worker Lifecycle Improvements:

  • Improved worker lifecycle management by introducing context cancellation for partition workers, ensuring clean shutdowns and better resource handling. [1] [2]

Dependency and Minor Cleanup:

  • Removed unused containerd/containerd dependencies from go.mod for cleanup. [1] [2]
  • Added missing import for time in router/throttler/factory.go.

Linear Ticket

resolves PIPE-2277

Security

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

Comment thread processor/integrations/integrations.go Outdated

@atzoum atzoum Aug 12, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note: this kind of validation was removed sometime ago, we no longer need the comment and the tag

Comment thread router/worker.go Outdated
Comment on lines 53 to 52

@atzoum atzoum Aug 12, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note: these were practically unused, leftovers from previous cleanups of unused functionalities

@atzoum
atzoum force-pushed the feat.deliveryThrottler branch 5 times, most recently from 7d89e0b to 8302da1 Compare August 13, 2025 12:09
@codecov

codecov Bot commented Aug 13, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.98218% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.88%. Comparing base (4446e5b) to head (b142792).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
router/worker.go 90.47% 22 Missing and 8 partials ⚠️
router/throttler/factory.go 87.23% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6225      +/-   ##
==========================================
- Coverage   76.91%   76.88%   -0.03%     
==========================================
  Files         521      522       +1     
  Lines       70764    70886     +122     
==========================================
+ Hits        54426    54499      +73     
- Misses      13460    13496      +36     
- Partials     2878     2891      +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.

@atzoum
atzoum force-pushed the feat.deliveryThrottler branch from 8302da1 to 7cd3957 Compare August 14, 2025 07:34
@atzoum
atzoum marked this pull request as ready for review August 14, 2025 07:34
Comment thread router/worker.go Resolved
@atzoum
atzoum force-pushed the feat.deliveryThrottler branch from 7cd3957 to 10d666b Compare August 14, 2025 15:18
@atzoum
atzoum force-pushed the feat.deliveryThrottler branch from 10d666b to a6fb598 Compare August 25, 2025 05:38
@atzoum
atzoum merged commit f55c7a8 into master Aug 25, 2025
@atzoum
atzoum deleted the feat.deliveryThrottler branch August 25, 2025 07:56
This was referenced Sep 1, 2025
itsmihir pushed a commit that referenced this pull request Sep 1, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.58.0-rc.1](v1.57.0...v1.58.0-rc.1)
(2025-09-01)


### Features

* implement error normalizer with similarity detection for reporting
([#6248](#6248))
([b4653d3](b4653d3))
* **router:** delivery throttler
([#6225](#6225))
([f55c7a8](f55c7a8))


### Bug Fixes

* cron tracker query causing master restarts
([#6252](#6252))
([51437b9](51437b9))
* snowpipe events getting duplicated if status API fails
([#6211](#6211))
([#6244](#6244))
([8d6838d](8d6838d))
* transformation metrics count amplification
([#6258](#6258))
([fded7b3](fded7b3))
* update table schema local repository
([#6255](#6255))
([2ec9a9f](2ec9a9f))
* update table schema local repository
([#6255](#6255))
([4446e5b](4446e5b))
* use source-id for getting cached schemas
([#6268](#6268))
([2ec9a9f](2ec9a9f))
* use source-id for getting cached schemas
([#6268](#6268))
([90e4191](90e4191))
* warehouse migrations from master only
([#6282](#6282))
([2309507](2309507))


### Miscellaneous

* add alert for stuck snowpipe pipeline
([#6271](#6271))
([2ec9a9f](2ec9a9f))
* add context information on ut http error logs
([#6278](#6278))
([424f22c](424f22c))
* bump amannn/action-semantic-pull-request from 5 to 6
([#6237](#6237))
([41c1548](41c1548))
* bump the go-deps group with 15 updates
([#6247](#6247))
([8d6838d](8d6838d))
* bump the go-deps group with 3 updates
([#6254](#6254))
([02a0263](02a0263))
* cleanup for schema snapshoting
([#6257](#6257))
([4f3a68f](4f3a68f))
* remove flaky GooglePubSub retry configuration tests
([#6260](#6260))
([6c48784](6c48784))
* remove null handling of upload id in load files
([#6241](#6241))
([8d6838d](8d6838d))
* remove unused network code
([#6266](#6266))
([f7cbc94](f7cbc94))
* **router:** rename endpointLabel to endpointPath
([#6279](#6279))
([c933525](c933525))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
itsmihir pushed a commit that referenced this pull request Sep 2, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.58.0-rc.2](v1.57.0...v1.58.0-rc.2)
(2025-09-02)


### Features

* implement error normalizer with similarity detection for reporting
([#6248](#6248))
([b4653d3](b4653d3))
* **router:** delivery throttler
([#6225](#6225))
([f55c7a8](f55c7a8))


### Bug Fixes

* cron tracker query causing master restarts
([#6252](#6252))
([51437b9](51437b9))
* snowpipe events getting duplicated if status API fails
([#6211](#6211))
([#6244](#6244))
([8d6838d](8d6838d))
* transformation metrics count amplification
([#6258](#6258))
([fded7b3](fded7b3))
* update table schema local repository
([#6255](#6255))
([2ec9a9f](2ec9a9f))
* update table schema local repository
([#6255](#6255))
([4446e5b](4446e5b))
* use getStringifiedSampleEvent for consistent sample event handling
([#6290](#6290))
([526975c](526975c))
* use source-id for getting cached schemas
([#6268](#6268))
([2ec9a9f](2ec9a9f))
* use source-id for getting cached schemas
([#6268](#6268))
([90e4191](90e4191))
* warehouse migrations from master only
([#6282](#6282))
([2309507](2309507))


### Miscellaneous

* add alert for stuck snowpipe pipeline
([#6271](#6271))
([2ec9a9f](2ec9a9f))
* add context information on ut http error logs
([#6278](#6278))
([424f22c](424f22c))
* bump amannn/action-semantic-pull-request from 5 to 6
([#6237](#6237))
([41c1548](41c1548))
* bump the go-deps group with 15 updates
([#6247](#6247))
([8d6838d](8d6838d))
* bump the go-deps group with 3 updates
([#6254](#6254))
([02a0263](02a0263))
* cleanup for schema snapshoting
([#6257](#6257))
([4f3a68f](4f3a68f))
* remove flaky GooglePubSub retry configuration tests
([#6260](#6260))
([6c48784](6c48784))
* remove null handling of upload id in load files
([#6241](#6241))
([8d6838d](8d6838d))
* remove unused network code
([#6266](#6266))
([f7cbc94](f7cbc94))
* **router:** rename endpointLabel to endpointPath
([#6279](#6279))
([c933525](c933525))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
itsmihir pushed a commit that referenced this pull request Sep 2, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.58.0](v1.57.0...v1.58.0)
(2025-09-02)


### Features

* implement error normalizer with similarity detection for reporting
([#6248](#6248))
([b4653d3](b4653d3))
* **router:** delivery throttler
([#6225](#6225))
([f55c7a8](f55c7a8))


### Bug Fixes

* cron tracker query causing master restarts
([#6252](#6252))
([51437b9](51437b9))
* snowpipe events getting duplicated if status API fails
([#6211](#6211))
([#6244](#6244))
([8d6838d](8d6838d))
* transformation metrics count amplification
([#6258](#6258))
([fded7b3](fded7b3))
* update table schema local repository
([#6255](#6255))
([2ec9a9f](2ec9a9f))
* update table schema local repository
([#6255](#6255))
([4446e5b](4446e5b))
* use getStringifiedSampleEvent for consistent sample event handling
([#6290](#6290))
([526975c](526975c))
* use source-id for getting cached schemas
([#6268](#6268))
([2ec9a9f](2ec9a9f))
* use source-id for getting cached schemas
([#6268](#6268))
([90e4191](90e4191))
* warehouse migrations from master only
([#6282](#6282))
([2309507](2309507))


### Miscellaneous

* add alert for stuck snowpipe pipeline
([#6271](#6271))
([2ec9a9f](2ec9a9f))
* add context information on ut http error logs
([#6278](#6278))
([424f22c](424f22c))
* bump amannn/action-semantic-pull-request from 5 to 6
([#6237](#6237))
([41c1548](41c1548))
* bump the go-deps group with 15 updates
([#6247](#6247))
([8d6838d](8d6838d))
* bump the go-deps group with 3 updates
([#6254](#6254))
([02a0263](02a0263))
* cleanup for schema snapshoting
([#6257](#6257))
([4f3a68f](4f3a68f))
* remove flaky GooglePubSub retry configuration tests
([#6260](#6260))
([6c48784](6c48784))
* remove null handling of upload id in load files
([#6241](#6241))
([8d6838d](8d6838d))
* remove unused network code
([#6266](#6266))
([f7cbc94](f7cbc94))
* **router:** rename endpointLabel to endpointPath
([#6279](#6279))
([c933525](c933525))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

3 participants