Skip to content

Connect tunnel drops 15–30×/day while idle (code 1006, heartbeat gaps, edge TLS handshake timeouts at ATL) #5880

Open

Description

@huntsyea

Summary

My bb Connect tunnel drops 15–30 times a day, mostly while it's idle. Each drop disconnects the bb web app on my phone. My bb server stays healthy throughout: it answers the tunnel's own requests in 1–3 ms around every drop, the Mac doesn't sleep, and the network path to getbb.app is clean. The drops look edge-side, at the ATL colo.

Environment

  • bb 0.46.1 (desktop app, macOS 26 / Darwin 25.5.0), MacBook Pro acting as the bb server
  • Wired network; keep-awake plugin enabled; system sleep prevented throughout
  • Connect plugin [email protected] (built-in), remote access on

Frequency (tunnel closed per day, from the connect plugin log)

Day Drops
10-13 26
10-14 16
10-15 29
10-16 17
10-17 15
10-18 8
10-19 22
10-20 (to 12:30 CT) 7

11 of the last 12 drops had zero proxied requests in the 2 minutes before. This doesn't look like #4314 (buffering large downloads): responses through the tunnel are small (median ~2.9 KB, max ~180 KB).

Three drops (times US Central, 2026-10-20)

1. Heartbeat gap, then a fast reconnect

12:04:07 warn tunnel closed (code 1006) {"transportError":null,"connectedDurationMs":9965363,"lastHeartbeatAckAgeMs":44564,"colo":"ATL","ray":"a4d8a62ccc9106f4-ATL"}
12:04:08 info tunnel connected {"lookupMs":32,"connectMs":46,"tlsMs":66,"upgradeMs":309,"ray":"a4d999917f5f0c85-ATL","colo":"ATL"}

2. Abrupt close while the heartbeat was fresh; slow upgrade on reconnect

12:23:40 warn tunnel closed (code 1006) {"transportError":null,"connectedDurationMs":1172246,"lastHeartbeatAckAgeMs":12149,"colo":"ATL","ray":"a4d999917f5f0c85-ATL"}
12:23:46 info tunnel connected {"lookupMs":31,"connectMs":46,"tlsMs":66,"upgradeMs":5015,"ray":"a4d9b6382ad1f5f5-ATL","colo":"ATL"}

3. 80 s heartbeat gap, then the edge doesn't complete the TLS handshake for about a minute (TCP connect is fine)

08:43:38 warn tunnel heartbeat missed; reconnecting
08:43:38 warn tunnel closed (code 1006) {"transportError":null,"connectedDurationMs":2120167,"lastHeartbeatAckAgeMs":79992,"colo":"ATL","ray":"a4d8401ebe1153c8-ATL"}
08:43:49 warn can't reach getbb.app — handshake timed out {"lookupMs":32,"connectMs":46,"tlsMs":null,"upgradeMs":null}
08:44:00 warn can't reach getbb.app — handshake timed out {"lookupMs":3,"connectMs":17,"tlsMs":null,"upgradeMs":null}
08:44:14 warn can't reach getbb.app — handshake timed out {"lookupMs":2,"connectMs":19,"tlsMs":null,"upgradeMs":null}
08:44:29 warn can't reach getbb.app — handshake timed out {"lookupMs":2,"connectMs":22,"tlsMs":null,"upgradeMs":null}
08:44:44 info tunnel connected {"lookupMs":2,"connectMs":20,"tlsMs":43,"upgradeMs":208,"ray":"a4d875800c02581f-ATL","colo":"ATL"}

What I ruled out on my side

  • Server stalls: proxied thread loads around each drop show originTtfbMs of 0.8–3 ms, and local requests answer in about 1 ms.
  • Sleep: pmset -g log shows no sleep or wake during the daytime drops; sleep is prevented by keep-awake.
  • Network: ping to getbb.app shows 0% loss, ~36 ms average; TLS to getbb.app completes in about 40 ms between drops.

Ask

  1. Could you check the edge side for these ray IDs: Durable Object resets or evictions, deploys, or TLS handshake stalls at ATL?
  2. On the client side, the phone web app drops its session on every tunnel reconnect, even the 1-second ones. A more graceful resume would hide most of these.

Activity

  1. added theissue type on Oct 20, 2026
  2. added
    remote
    connect
    partial-repro
    on Oct 20, 2026
  3. bb-slop-cop commented on Oct 20, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority: Medium · Effort: Medium · Areas: remote, connect.
    • Report: Reproduction and root-cause investigation.
    • Verdict: PARTIALLY REPRODUCED · Confidence: low for the spontaneous idle-drop cause; high for the downstream teardown mechanism · Reproduction label: partial-repro.
    • Finding: On trusted main, injected tunnel loss or replacement immediately closes established visitor WebSockets through TunnelDO.abandonStreams; new connections work after redial. This does not establish an ATL edge failure, reproduce the recurring idle drops, or demonstrate authentication loss.
    • Verification: Same-agent reproduction in two clean checkouts; 3 diagnostic cases repeated, 153 existing gate tests and 26 tunnel-client tests passed. Full test sources and observed output are inline in the report.
    • No PR: The spontaneous idle failure was not reproduced, and transparent stream continuation requires a lifecycle/design decision rather than a verified simple fix.
  4. salemsayed commented on Oct 28, 2026

    @salemsayed
    Contributor

    Same pattern on a Linux dedicated server (bb 0.47.2-nightly, salem.getbb.app), so it's not specific to ATL or macOS sleep.

    From the connect plugin log, 2026-10-18 → 10-28:

    • 120 tunnel closed (code 1006), 4–20 per day, all with transportError: null.
    • 111 of 120 closed while the last heartbeat ack was ≤20 s old.
    • Spread over 8 colos: FRA 65, TXL 36, CDG 6, VIE 5, DUS/BEG/MUC/AMS 2 each.
    • Nothing local lines up with them: within ±60 s of today's drops there are only unrelated provider-catalog logs and sub-second DB queries, and there have been no event-loop stalls since 10-19.
    • Reconnects: TLS done at 58 ms p50, but the gate's 101 (upgradeMs) takes 766 ms p50 / 6.0 s p90 / 8.4 s max; 31 of 120 took longer than 3 s.
    • 3 dials timed out after TLS while waiting on the gate.

    Today's closed and new rays, plus a gate 502 window at 16:44–16:46 UTC while this tunnel stayed connected, are in #6450 (comment).

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    connectpartial-reproremote

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions