Commit 680c9f1
fix: narrow _run_protocol invalidation to transport-level errors
The catch-all except BaseException invalidated the connection on any
error — including client-side encoding bugs, user TypeError/ValueError
from bad params, and other pre-write failures that leave the wire state
intact. Every such error destroyed the socket and, via the pool's
drain-on-dead-connection logic, tore down all idle connections too.
Invalidate only for the actual wire-state-damaging cases:
DqliteConnectionError, ProtocolError, OperationalError with a leader
code, and CancelledError / KeyboardInterrupt / SystemExit (where the
request/response round-trip was interrupted mid-flight). Let
programming / encoding errors propagate with the connection intact.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent bf8ddf3 commit 680c9f1
2 files changed
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
245 | 248 | | |
246 | 249 | | |
247 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
761 | 781 | | |
762 | 782 | | |
763 | 783 | | |
| |||
0 commit comments