Harden control plane connection management and optimize worker initialization#228
Merged
fuziontech merged 3 commits intomainfrom Feb 18, 2026
Merged
Harden control plane connection management and optimize worker initialization#228fuziontech merged 3 commits intomainfrom
fuziontech merged 3 commits intomainfrom
Conversation
…lization Resolved Fivetran job failures caused by worker initialization timeouts and resource contention during concurrent "ATTACH" operations. Key improvements: - Worker Reusability: Workers are now pooled and reused across sequential sessions, avoiding the overhead of spawning a new process for every connection. Idle workers are reaped after a configurable 5-minute timeout. - Shared Worker State: All sessions within a worker process now share a single sql.DB instance (with dedicated sql.Conn for isolation). This allows sessions to share pre-loaded extensions and attached DuckLake catalogs, making subsequent session creation near-instant. - Background Pre-warming: Workers now perform full DuckDB initialization (loading extensions, attaching catalogs) at startup in the background. This ensures workers are "warm" and ready to serve before handling their first client request. - Parallel Spawning: Pre-warmed workers are spawned in parallel to accelerate control-plane startup. - Configuration: Added 'worker_idle_timeout' (default 5m) to duckgres.yaml and CLI flags. These changes eliminate the "spawn storms" observed under heavy load and ensure that client connections receive a 'ReadyForQuery' response within milliseconds after authentication.
|
🤖 Hi @fuziontech, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
|
🤖 I'm sorry @fuziontech, but I was unable to process your request. Please see the logs for more details. |
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.
Resolved Fivetran job failures caused by worker initialization timeouts and resource contention during concurrent "ATTACH" operations.
Key improvements:
These changes eliminate the "spawn storms" observed under heavy load and ensure that client connections receive a 'ReadyForQuery' response within milliseconds after authentication.