Commit ab6b90e
authored
π fix(rw): close sqlite3 cursors and skip SoftFileLock Windows race (#491)
ReadWriteLock._configure_and_begin creates cursors via
Connection.execute() without closing them. On CPython refcounting
destroys them immediately, but on PyPy cursors accumulate until
non-deterministic GC collects them. If Connection.__del__ runs first
and calls sqlite3_close, a later Statement.__del__ calls
sqlite3_finalize on freed memory β segfault. Fix by chaining .close()
on every execute() call.
Skip test_threaded_shared_lock_obj for SoftFileLock on Windows.
SoftFileLock uses file-existence locking where unlink can silently fail
under heavy thread contention when an antivirus scanner or search
indexer momentarily holds the handle after close(). This orphans the
lock file with no recovery path since stale-lock detection is disabled
on Windows and PID-based detection cannot distinguish same-process
threads. This is the same known limitation already documented by the
skip in test_threaded_lock_different_lock_obj.1 parent 98b4ee9 commit ab6b90e
2 files changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
245 | 251 | | |
246 | 252 | | |
247 | 253 | | |
| |||
0 commit comments