Commit 9785584
authored
Replace per-connection execution lock with statement-level interrupts (#226)
Query timeouts previously relied on a per-connection execution lock that
serialized every operation so the timer wheel's connection.interrupt()
would
unambiguously hit the timed-out operation. This serialized all
concurrent work
on a connection and added a mutex acquisition to every call.
Use libsql_stmt_interrupt() instead: the timer wheel now interrupts the
specific statement that timed out (via a new Interruptible trait, so the
wheel
can target either a statement or a connection), leaving other concurrent
operations on the same connection untouched. This removes execution_lock
entirely, along with acquire_execution_lock and the deadline/remaining
plumbing it required.
Depends on: tursodatabase/libsql#22484 files changed
Lines changed: 179 additions & 154 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
560 | 561 | | |
561 | 562 | | |
562 | 563 | | |
563 | | - | |
| 564 | + | |
564 | 565 | | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
572 | 575 | | |
573 | 576 | | |
574 | 577 | | |
575 | 578 | | |
576 | | - | |
| 579 | + | |
577 | 580 | | |
578 | 581 | | |
579 | 582 | | |
| |||
0 commit comments