Commit a1ee292
fix: Remove connection testing that was causing constant reconfiguration
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>1 parent 13f915e commit a1ee292
1 file changed
Lines changed: 3 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
| 146 | + | |
146 | 147 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 148 | + | |
179 | 149 | | |
180 | 150 | | |
181 | 151 | | |
| |||
0 commit comments