Repository navigation
fix(processor): throughput stalling due to mutex deadlock on full connection pool - #5919
Merged
Merged
Conversation
cisse21
approved these changes
May 28, 2025
fracasula
approved these changes
May 28, 2025
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/1.50.x #5919 +/- ##
=================================================
Coverage ? 76.90%
=================================================
Files ? 494
Lines ? 68201
Branches ? 0
=================================================
Hits ? 52450
Misses ? 12880
Partials ? 2871 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merged
atzoum
pushed a commit
that referenced
this pull request
May 28, 2025
🤖 I have created a release *beep* *boop* --- ## [1.50.2](v1.50.1...v1.50.2) (2025-05-28) ### Bug Fixes * **processor:** throughput stalling due to mutex deadlock on full connection pool ([#5919](#5919)) ([a29dd15](a29dd15)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
atzoum
added a commit
that referenced
this pull request
May 28, 2025
# Description Syncing patch release v1.50.2 to main branch **↓↓ Please review and edit commit overrides before merging ↓↓** BEGIN_COMMIT_OVERRIDE fix(processor): throughput stalling due to mutex deadlock on full connection pool (#5919) END_COMMIT_OVERRIDE --------- Co-authored-by: Akash Chetty <[email protected]> Co-authored-by: shekhar-rudder <[email protected]> Co-authored-by: Aris Tzoumas <[email protected]>
This was referenced Jun 4, 2025
Merged
atzoum
pushed a commit
that referenced
this pull request
Jun 9, 2025
🤖 I have created a release *beep* *boop* --- ## [1.51.0-rc.2](v1.50.0...v1.51.0-rc.2) (2025-06-09) ### Features * integrate the transformer client with cslb for source transformations ([#5881](#5881)) ([53b8156](53b8156)) * triggers deployment for staging and hosted releases ([#5950](#5950)) ([c8d849e](c8d849e)) ### Bug Fixes * block internal IP access as destination ([#5888](#5888)) ([a0a4b91](a0a4b91)) * collected metric named router_process_jobs_count collides with previously collected histogram named router_process_jobs ([#5966](#5966)) ([d60d224](d60d224)) * **processor:** throughput stalling due to mutex deadlock on full connection pool ([#5919](#5919)) ([b18df16](b18df16)) * under reporting of load files when using upload id ([#5889](#5889)) ([4a3a11c](4a3a11c)) * under reporting of load files when using upload id ([#5889](#5889)) ([#5906](#5906)) ([4f300cf](4f300cf)) * use jsonrs stdlib for encoding warehouse transformations ([#5945](#5945)) ([0963a17](0963a17)) * warehouse transformations geo enrichment as string ([#5907](#5907)) ([4f300cf](4f300cf)) * warehouse transformations responses ordering ([#5954](#5954)) ([ea1a527](ea1a527)) ### Miscellaneous * add config to disable load table stats for clickhouse ([#5932](#5932)) ([55c26f2](55c26f2)) * add event delivery metrics for async destinations ([#5930](#5930)) ([7e9f1b5](7e9f1b5)) * add new metric regulation_worker_deletion_status_count ([#5939](#5939)) ([1aa00f9](1aa00f9)) * add test case for dynamic config pattern with numeric default value ([#5904](#5904)) ([9cd7180](9cd7180)) * clean up destinationInfo from refreshTokenParams ([#5897](#5897)) ([4eb40cd](4eb40cd)) * **deps:** bump github.com/apache/pulsar-client-go from 0.15.1-candidate-2 to 0.15.1 ([#5895](#5895)) ([4a3a11c](4a3a11c)) * fix aws sdk v2 ([#5928](#5928)) ([e5b0ab4](e5b0ab4)) * flakiness in upload jobs count ([#5913](#5913)) ([b167104](b167104)) * proc sample store uploader ([#5917](#5917)) ([2e3b796](2e3b796)) * remove unused schemas repo in warehouse router ([#5879](#5879)) ([4e96935](4e96935)) * **router:** adaptive throttler decreasing throttling rate dynamically based on current throttled rate ([#5931](#5931)) ([3d3b5b3](3d3b5b3)) * **router:** use different stats for capturing process stage jobs and requests ([#5944](#5944)) ([6728b2a](6728b2a)) * use zero transport on new common reporting client ([#5959](#5959)) ([d35e2cc](d35e2cc)) * warehouse transformations json diff with encoding ([#5937](#5937)) ([2e3b796](2e3b796)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
atzoum
pushed a commit
that referenced
this pull request
Jun 9, 2025
🤖 I have created a release *beep* *boop* --- ## [1.51.0-rc.3](v1.50.0...v1.51.0-rc.3) (2025-06-09) ### Features * integrate the transformer client with cslb for source transformations ([#5881](#5881)) ([53b8156](53b8156)) * triggers deployment for staging and hosted releases ([#5950](#5950)) ([c8d849e](c8d849e)) ### Bug Fixes * block internal IP access as destination ([#5888](#5888)) ([a0a4b91](a0a4b91)) * collected metric named router_process_jobs_count collides with previously collected histogram named router_process_jobs ([#5966](#5966)) ([d60d224](d60d224)) * **processor:** throughput stalling due to mutex deadlock on full connection pool ([#5919](#5919)) ([b18df16](b18df16)) * router request failing with unsupported media type error ([#5968](#5968)) ([edaa10c](edaa10c)) * under reporting of load files when using upload id ([#5889](#5889)) ([4a3a11c](4a3a11c)) * under reporting of load files when using upload id ([#5889](#5889)) ([#5906](#5906)) ([4f300cf](4f300cf)) * use jsonrs stdlib for encoding warehouse transformations ([#5945](#5945)) ([0963a17](0963a17)) * warehouse transformations geo enrichment as string ([#5907](#5907)) ([4f300cf](4f300cf)) * warehouse transformations responses ordering ([#5954](#5954)) ([ea1a527](ea1a527)) ### Miscellaneous * add config to disable load table stats for clickhouse ([#5932](#5932)) ([55c26f2](55c26f2)) * add event delivery metrics for async destinations ([#5930](#5930)) ([7e9f1b5](7e9f1b5)) * add new metric regulation_worker_deletion_status_count ([#5939](#5939)) ([1aa00f9](1aa00f9)) * add test case for dynamic config pattern with numeric default value ([#5904](#5904)) ([9cd7180](9cd7180)) * clean up destinationInfo from refreshTokenParams ([#5897](#5897)) ([4eb40cd](4eb40cd)) * **deps:** bump github.com/apache/pulsar-client-go from 0.15.1-candidate-2 to 0.15.1 ([#5895](#5895)) ([4a3a11c](4a3a11c)) * fix aws sdk v2 ([#5928](#5928)) ([e5b0ab4](e5b0ab4)) * flakiness in upload jobs count ([#5913](#5913)) ([b167104](b167104)) * proc sample store uploader ([#5917](#5917)) ([2e3b796](2e3b796)) * remove unused schemas repo in warehouse router ([#5879](#5879)) ([4e96935](4e96935)) * **router:** adaptive throttler decreasing throttling rate dynamically based on current throttled rate ([#5931](#5931)) ([3d3b5b3](3d3b5b3)) * **router:** use different stats for capturing process stage jobs and requests ([#5944](#5944)) ([6728b2a](6728b2a)) * use zero transport on new common reporting client ([#5959](#5959)) ([d35e2cc](d35e2cc)) * warehouse transformations json diff with encoding ([#5937](#5937)) ([2e3b796](2e3b796)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
Description
When
Processor.enableConcurrentStoreis enabled, the processor performs the following operations concurrently:Each of these operations uses a separate database connection.
In the "store router jobs" operation, before opening a connection, a mutex is acquired per destinationID to ensure that only one goroutine inserts jobs for a given destination at a time.
However, this can lead to a deadlock under high load: if all database connections in the pool are occupied by goroutines waiting to acquire a destinationID mutex, and the one goroutine that has acquired the mutex is blocked waiting for a database connection, progress stalls. The result is a circular wait where no goroutine can proceed, causing the processor's throughput to stall..
To fix this deadlock, whenever
Processor.enableConcurrentStoreis enabled, we're acquiring the mutexes early, before any other connection.Additionally, we're increasing the default connection pool size to 80 and limiting it to 20 for gateway.
Linear Ticket
resolves PIPE-2101
Security