Commit b0a6ef2
Narrow connect-cleanup suppress in ClusterClient.connect to match pool's shielded-cleanup discipline
The ``try_connect`` cleanup arm wrapped
``await asyncio.shield(conn.close())`` in a
``contextlib.suppress(BaseException)``. The wide width
swallowed everything the shielded close could raise —
including ``KeyboardInterrupt`` / ``SystemExit`` (signal
shutdowns), programming-bug class exceptions like
``AttributeError``, and any unexpected ``Exception`` — and
the bare ``raise`` after the suppress re-raised the original
handshake exception, supplanting the new signal entirely.
Mirror the pool's canonical pattern at
``pool.py:1018-1042``:
* ``asyncio.CancelledError`` is absorbed (asyncio re-
delivers at the next await; the bare ``raise`` re-
delivers the original handshake exception, so the
outer-cancel signal is not lost — just delayed by one
await boundary).
* ``OSError`` / ``DqliteConnectionError`` are caught and
logged (transport-class teardown failures on a half-
built conn are expected).
* ``KI`` / ``SystemExit`` / other ``Exception`` subclasses
propagate — these are the cases the wide suppress was
silently dropping.
The cleanup arm's intent (drain the inner client's
``_pending_drain`` task before the half-built conn falls
out of scope) is preserved; only the failure-mode width
changes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent bb87ee2 commit b0a6ef2
2 files changed
Lines changed: 87 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
584 | 584 | | |
585 | 585 | | |
586 | 586 | | |
587 | | - | |
588 | | - | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
589 | 612 | | |
590 | 613 | | |
591 | 614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
0 commit comments