Fail fast when an adopted Cloud tunnel drops during status read

Merged
TE
2mo ago
+8-1

Fixes #13434.

Summary

Fixes the deterministic current-main timeout observed in app-host CI while hardening failure accounting.

Red-before evidence: CI run 35635891245, app-host shard 1/6, logical batch 7/12. CloudTunnelCoordinatorTests/adoptedConnectingLinkFailsFastOnDisconnect started at 18:33:31 UTC, hit the 120-second per-test allowance at 18:35:31, and forced an app-host restart.

The race:

  1. the first status snapshot captures .connecting;
  2. while currentStatus() is suspended, the controller reports .disconnected;
  3. the confirming read sees .disconnected;
  4. the coordinator treated that as a fresh-start case and waited the full connect timeout.

The fix retains the first snapshot status. If an adopted .connecting / .reasserting link is confirmed dropped during that snapshot, the coordinator surfaces the existing link-dropped failure immediately. The existing test already asserts the desired cleanup path: no fresh start, state becomes failed, and cleanup calls are ["install", "stop"].

This is a product fix, separate from the CI harness/ratchet work in #13421.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Fails fast when an adopted Cloud tunnel drops while its status is being read, fixing a CI timeout where the coordinator treated the drop as a fresh start and waited the full connect timeout.

  • Retains the first status snapshot so an adopted .connecting or .reasserting link confirmed as .disconnected or .invalid surfaces the existing link-dropped failure immediately.