Commit 1e10d3c
Wait briefly for the cancelled coroutine to unwind on sync timeout
Connection._run_sync called future.cancel() on sync-side timeout and
returned the OperationalError to the caller immediately. The
coroutine was still unwinding on the loop thread, possibly still
holding the underlying DqliteConnection's _in_use flag — so the
caller's very next sync method (commit, close, another execute)
observed "another operation is in progress" until the prior
coroutine actually caught CancelledError and finished its finally
blocks. Bound a 1-second wait for the cancellation to land before
raising; _invalidate stays as fire-and-forget for the genuinely-stuck
case.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d777f65 commit 1e10d3c
1 file changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
226 | 240 | | |
227 | 241 | | |
228 | 242 | | |
| |||
0 commit comments