Commit 46ba6f3
committed
fix: hold _conn_lock across check-create-append in _get_connection()
Previously the lock was acquired for the closed check, released, then
reacquired for the append — leaving a window where close() could run
between check and append, leaking the new connection. The fast path
(existing connection) remains lock-free since _thread_local is per-thread.1 parent 424c805 commit 46ba6f3
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
205 | 208 | | |
206 | 209 | | |
207 | 210 | | |
208 | | - | |
209 | | - | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| |||
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
219 | | - | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| |||
0 commit comments