Commit c8c6067
fix(consul-postgres-ha): mesh-conn PacketConn shim must delegate deadlines
Discovered while verifying terraform's beta.3 env-update path against
the live cluster on 2026-05-04: when terraform recreates a CVM, the
peers' QUIC links to it die, but the *redial* path can hang.
Specifically: dialICE returns a Connected ice.Conn, dialAndPump enters
quic.Dial, ICE later goes Failed (peer went away again, hairpin lost,
etc.). quic.Dial's context times out and quic-go calls
SetReadDeadline(past) to interrupt the blocked ReadFrom in our
iceConnPacketConn shim. The shim was returning nil from
SetReadDeadline, so the call had no effect on the underlying
ice.Conn.Read, and the goroutine hung forever. The surrounding
runPeerLink retry loop never got to retry, leaving the peer slot
permanently dead until the entire mesh-conn process was restarted.
Fix: delegate SetDeadline / SetReadDeadline / SetWriteDeadline to the
underlying conn (pion/ice.Conn implements net.Conn deadlines properly).
Same fix applied to the stage4/quic-on-ice smoke test so future
debugging stays trustworthy.
Adds a regression test using net.Pipe (which honors deadlines) that
asserts ReadFrom returns a Timeout-flagged net.Error within ~50ms of
SetReadDeadline.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0f912d7 commit c8c6067
3 files changed
Lines changed: 62 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
697 | 697 | | |
698 | 698 | | |
699 | 699 | | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
705 | 714 | | |
706 | 715 | | |
707 | 716 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
0 commit comments