Commit a3a63b1
chore(consul-postgres-ha): env-gated pion ICE debug logs (MESH_CONN_DEBUG_ICE)
Plumbed `mesh_conn_debug_ice` from terraform.tfvars through cluster.tf
+ both compose templates + entrypoint into mesh-conn, where setting
the env to "1" wires `logging.NewDefaultLoggerFactory()` at LogLevelTrace
into pion's ice.AgentConfig. Used to diagnose the post-hot-patch
worker↔coord ICE-failure mode (see findings below). Off by default —
the trace output is very chatty.
Findings from one full instrumented run on the live cluster:
- pion's outbound STUN BINDING_REQUESTs are sent normally over the
TURN allocation (~1Hz to each candidate pair).
- ZERO inbound STUN ever arrives at the workers' pion after a sidecar
restart. `agent.go:1092 Inbound STUN` log line never appears in
worker-3's log; eventually pion logs `Maximum requests reached for
pair ... marking it as failed` and the agent gives up.
- Coordinators' pion DOES receive inbound STUN (from workers, in
fact) and successfully NOMINATE candidate pairs — coord-0 logged
`selected pair: relay 155.138.146.255:49666 <-> relay
155.138.146.255:49456 (proto=udp)` for [worker-3] within ~3s of
worker-3 republishing post-restart. So the path is genuinely
half-open: worker→coord traffic flows, coord→worker doesn't.
- coturn shows zero rejections / quota / permission errors throughout.
Allocation count rises and falls cleanly.
- All 6 CVMs share the same public IP (66.220.6.107 = dstack provider
NAT). Different per-CVM source ports.
Conclusion: the asymmetric inbound-UDP failure is at the dstack
edge NAT, not at mesh-conn or coturn. Workers post-restart can't
receive inbound UDP from the relay on coturn's high port range
(155.138.146.255:49152-49999), even though coordinators on the same
cluster can. This is likely a NAT-mapping lifecycle issue (the new
post-restart mapping permits coturn:3478 source but not the
coturn:relay-port source), but proving that needs platform-side
inspection that we don't have access to.
Approach 2 (the partial fix in 5548bab) catches the stale-auth race
when it does fire, but the underlying inbound-UDP-blocked condition
prevents convergence regardless. The fix stays in (catches a real
race, doesn't make anything worse); the dstack-platform UDP behavior
needs a separate investigation and fix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent cc5a12d commit a3a63b1
5 files changed
Lines changed: 25 additions & 3 deletions
File tree
- consul-postgres-ha
- cluster-example
- compose
- mesh-conn
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
113 | 121 | | |
114 | 122 | | |
115 | 123 | | |
| |||
188 | 196 | | |
189 | 197 | | |
190 | 198 | | |
| 199 | + | |
191 | 200 | | |
192 | 201 | | |
193 | 202 | | |
| |||
233 | 242 | | |
234 | 243 | | |
235 | 244 | | |
| 245 | + | |
236 | 246 | | |
237 | 247 | | |
238 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
919 | 920 | | |
920 | 921 | | |
921 | 922 | | |
922 | | - | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
923 | 927 | | |
924 | 928 | | |
925 | 929 | | |
926 | | - | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
927 | 937 | | |
928 | 938 | | |
929 | 939 | | |
| |||
0 commit comments