Skip to content

Release/25.11.2#65

Merged
xe-nvdk merged 2 commits into
mainfrom
release/25.11.2
Nov 24, 2025
Merged

Release/25.11.2#65
xe-nvdk merged 2 commits into
mainfrom
release/25.11.2

Conversation

@xe-nvdk
Copy link
Copy Markdown
Member

@xe-nvdk xe-nvdk commented Nov 24, 2025

No description provided.

Ignacio Van Droogenbroeck and others added 2 commits November 24, 2025 15:41
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>
@xe-nvdk xe-nvdk merged commit b004be4 into main Nov 24, 2025
13 checks passed
@xe-nvdk xe-nvdk deleted the release/25.11.2 branch November 24, 2025 20:14
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.

1 participant