Release/25.11.2#65
Merged
Merged
Conversation
Root cause: When DuckDB closes connections during errors, the cleanup test fails and the previous fix (08b2d98) dropped the connection instead of replenishing it. This caused the pool to shrink from N to 0 over time, leading to query queuing and memory accumulation. Evidence from production logs (h01-customers-basekick-net): - Connection cleanup failed (Connection Error: Connection already closed) every 10s - Memory growing from 12% to 13% continuously despite GC running The fix: When connection cleanup fails, create a fresh DuckDB connection with the same configuration and return it to the pool. This maintains pool size and prevents query queuing. Changes: - Create fresh connection using duckdb.connect() when cleanup fails - Apply configure_fn to maintain consistent connection configuration - Return fresh connection to pool to maintain pool size - Handle configuration errors gracefully 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Root cause analysis: - Every query was triggering 'Connection invalid during cleanup' warnings - The SELECT 1 test after each query was failing (DuckDB connections closed) - This caused expensive configure_fn to run on every query (install extensions, set 56 threads, etc) - Query latency increased from 80ms to 180ms due to reconfiguration overhead The fix: - Remove connection testing entirely - DuckDB connections are stateless - Just return connections directly to the pool after use - Eliminates constant connection recreation and reconfiguration - Should restore query latency to 80ms range Evidence: Production logs showed configure_fn running after EVERY query, not just at pool initialization. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
No description provided.