Repository navigation
Resubscribe the feed when its socket stays connected and stops delivering - #1056
Merged
Merged
Conversation
…ring After the Cable Redis failover on 2026-10-23 a connector's socket kept receiving keep-alives while its subscription delivered almost nothing. Every frame re-arms the SDK's staleness window, so the socket was never stale, and the repair poll carried every event about a minute late until someone restarted the connector by hand. The repair poll runs about thirty seconds behind the live lane, so in steady state the events it serves were already delivered live and it finds nothing new. Intake now counts, per repair walk, the new events each lane brought. When the last three walks found at least three new events by poll, in at least two of the walks, and more than the socket delivered, it resubscribes through the reconnect it already uses for a membership change, resuming from the saved position. Not counted: the catch-up walk after a connect, loss repairs, and any walk in which the feed's goroutine spent more than ten seconds in intake (deliveries, observer callbacks, the signal handler) or the live buffer overflowed, together with the next repair walk. While intake is held up the socket's frames wait in the SDK, and a poll that reaches them first suppresses their live copies, so those walks restart the span rather than count against the socket. A resubscribe that does not bring live delivery back doubles the span before the next one, up to 48 walks (about 48 minutes), and a full span in which the socket delivered at least what the poll found resets it. Basecamp card: https://app.basecamp.com/2914079/buckets/48699913/card_tables/cards/10435111118
Contributor
There was a problem hiding this comment.
🟢 Approved
No active review issues are recorded for the automatic live-feed recovery change.
No open issues 🎉
What changed in this PR
Adds automatic recovery when the connector’s live feed stays connected but stops delivering events, reducing reliance on delayed repair polls and manual restarts.
Changes:
- Detects repeated poll-only delivery and resubscribes through the existing reconnect path.
- Excludes catch-up, loss repairs, and local stalls or buffer overflows from the evidence; backs off when resubscribing does not help.
- Adds unit and feed-loop tests for detection, healthy sockets, backoff, and stall handling.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
internal/connector/intake.go |
Tracks delivery counts and blocked time, then requests reconnects when needed. |
internal/connector/feed_liveness.go |
Implements detection thresholds, evidence exclusions, and retry backoff. |
internal/connector/feed_liveness_test.go |
Tests detection rules and reconnect behavior through the feed loop. |
Review effort: Balanced
jeremy
added a commit
that referenced
this pull request
Nov 23, 2026
…950575 * origin/main: Keep a person's client flag when it is false (#1055) Filter gauge listings by chosen projects (#1049) Say how to recover a broken connect.json, and keep reporting around it (#1053) Support schedule entry drafts, highlights, and join links (#1019) Let auth login reach a beta preview on a private network (#1054) Resubscribe the feed when its socket stays connected and stops delivering (#1056)
jeremy
added a commit
that referenced
this pull request
Nov 23, 2026
…983764 * origin/main: (47 commits) Keep a person's client flag when it is false (#1055) Filter gauge listings by chosen projects (#1049) Say how to recover a broken connect.json, and keep reporting around it (#1053) Support schedule entry drafts, highlights, and join links (#1019) Let auth login reach a beta preview on a private network (#1054) Resubscribe the feed when its socket stays connected and stops delivering (#1056) Open pin-comment repair PRs as the org PR bot (#1052) Stop approving Dependabot PRs with GITHUB_TOKEN (#1048) Send mentions and files back bare when rich text is edited (#1046) Bump the basecamp/mcp toolkit, and title every MCP tool (#1045) Stop telling an agent to send a Markdown fold as HTML (#1030) Update nix flake and plugin version for v0.30.0 (#1042) Watch a connector in a terminal, and talk to its orchestrator (#1039) Lift the connector's cap on workers, and let a start set one (#1040) Never give the connector's monitor a timeout (#1035) Update nix flake and plugin version for v0.29.0 (#1037) Let assignments notify people with --notify (#1034) Update nix flake and plugin version for v0.28.1 Bind local config trust to approved settings Update nix flake and plugin version for v0.28.0 (#1029) ... # Conflicts: # API-COVERAGE.md # skills/basecamp/SKILL.md
jeremy
added a commit
that referenced
this pull request
Nov 23, 2026
…988117 * origin/main: (42 commits) Keep a person's client flag when it is false (#1055) Filter gauge listings by chosen projects (#1049) Say how to recover a broken connect.json, and keep reporting around it (#1053) Support schedule entry drafts, highlights, and join links (#1019) Let auth login reach a beta preview on a private network (#1054) Resubscribe the feed when its socket stays connected and stops delivering (#1056) Open pin-comment repair PRs as the org PR bot (#1052) Stop approving Dependabot PRs with GITHUB_TOKEN (#1048) Send mentions and files back bare when rich text is edited (#1046) Bump the basecamp/mcp toolkit, and title every MCP tool (#1045) Stop telling an agent to send a Markdown fold as HTML (#1030) Update nix flake and plugin version for v0.30.0 (#1042) Watch a connector in a terminal, and talk to its orchestrator (#1039) Lift the connector's cap on workers, and let a start set one (#1040) Never give the connector's monitor a timeout (#1035) Update nix flake and plugin version for v0.29.0 (#1037) Let assignments notify people with --notify (#1034) Update nix flake and plugin version for v0.28.1 Bind local config trust to approved settings Update nix flake and plugin version for v0.28.0 (#1029) ... # Conflicts: # API-COVERAGE.md
jeremy
added a commit
that referenced
this pull request
Nov 24, 2026
…989271 * origin/main: (45 commits) Keep a person's client flag when it is false (#1055) Filter gauge listings by chosen projects (#1049) Say how to recover a broken connect.json, and keep reporting around it (#1053) Support schedule entry drafts, highlights, and join links (#1019) Let auth login reach a beta preview on a private network (#1054) Resubscribe the feed when its socket stays connected and stops delivering (#1056) Open pin-comment repair PRs as the org PR bot (#1052) Stop approving Dependabot PRs with GITHUB_TOKEN (#1048) Send mentions and files back bare when rich text is edited (#1046) Bump the basecamp/mcp toolkit, and title every MCP tool (#1045) Stop telling an agent to send a Markdown fold as HTML (#1030) Update nix flake and plugin version for v0.30.0 (#1042) Watch a connector in a terminal, and talk to its orchestrator (#1039) Lift the connector's cap on workers, and let a start set one (#1040) Never give the connector's monitor a timeout (#1035) Update nix flake and plugin version for v0.29.0 (#1037) Let assignments notify people with --notify (#1034) Update nix flake and plugin version for v0.28.1 Bind local config trust to approved settings Update nix flake and plugin version for v0.28.0 (#1029) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After the Cable Redis failover on 23 October, a connector's live socket stayed connected and kept getting keep-alives, but its subscription delivered almost nothing. The SDK resets its staleness timer on every frame, pings included, so nothing noticed. The once-a-minute repair poll carried every event about a minute late until someone restarted the connector by hand. Card: Connector doesn't notice when its live feed stops delivering after a Cable failover.
This makes the connector notice and resubscribe on its own.
How it tells a dead socket from a quiet one
The repair poll runs about 30 seconds behind the live socket. In steady state, everything it serves was already delivered live, so dedupe leaves it nothing new. Intake now counts, per repair walk, the new events each lane brought. When the last three walks found at least 3 new events by poll, spread over at least 2 of those walks, and more than the socket delivered, intake resubscribes. It uses the reconnect it already has for membership changes, which resumes from the saved position, so nothing is lost. That covers the partial loss seen on the day (about 80% of events polled), not only a fully dead socket.
These don't count as evidence:
While intake is held up, the socket's frames wait in the SDK, and a poll that reaches them first suppresses their live copies. Counting those walks would blame a healthy socket.
If resubscribing doesn't bring live delivery back (Cable down for everyone), the span doubles before the next try, up to 48 walks (about 48 minutes). A full span in which the socket delivered at least what the poll found resets it.
Verification
main. A throwaway test against the real feed loop with the SDK fakes: pings every second for 10s (past the 7.5s staleness window) and a 250ms repair poll. All 40 events came by poll, none came live, there was 1 dial and no stale warning. A control without pings went stale and was redialed.TestIntakeResubscribesASocketThatOnlyAnswersKeepalivesruns the same deaf socket through the feed loop and checks that it is replaced on the third repair walk, not before and not after.TestIntakeKeepsASocketThatDeliversis the control: the same pings and poll, with the socket delivering each event first, and the socket is kept.TestIntakeHoldsTheVerdictWhileIntakeIsBusyruns a deaf socket behind a slow admission queue, and the socket is kept.-race.bin/ciis green on 32a83f5.Review
Codex (gpt-6.1-sol, high) did four local adversarial passes in the worktree. None was posted to this PR.
Copilot reviewed the head commit, 32a83f5, covering all three changed files, and approved with no findings. The posted review is on this PR.
Built by R2-D2 (Rob's agent) on Claude Opus 5.5.