Repository navigation
fix(relay): tunnel cleanup keeps up with new idle tunnels - #26135
Conversation
The reaper hit its 100-deletes-per-sweep cap on 93% of sweeps, so new idle tunnels arrived as fast as it removed them and the backlog stopped shrinking at 5.5k-8.5k. Allow 250 deletes per sweep at concurrency 8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Increases idle-tunnel cleanup throughput while retaining existing deletion eligibility, ownership checks, time limits, and rate-limit safeguards. Product behavior and retention thresholds remain unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Update rate-limit figures docs/operations/relay-observability.md |
The alert guidance states an account limit of 20,000 calls per 5 minutes and peak usage of about 2,100. |
Managed endpoint reaper
| Layer / File(s) | Summary |
|---|---|
Update sweep limits and test thresholds infra/relay/src/environments/ManagedEndpointReaper.ts, infra/relay/src/environments/ManagedEndpointReaper.test.ts |
The attempt limit increases from 100 to 250, and delete concurrency increases from 4 to 8. The deletion-order tests use the configured attempt limit for candidate counts and assertions. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Possibly related PRs
- pingdotgg/t3code#23683: Updates the same reaper cleanup path to pass recovery state and generation to
ManagedEndpointProvider.release.
Suggested reviewers: maria-rcks, t3dotgg
Merge Risk: 
Minimal · up to bef28
-
No demonstrated issue prevents merging the sweep-limit and guidance updates after normal checks.
Pre-merge checks: 
3 · 
1
-
Failed checks: 1 warning Passed checks: 3 passedFull details: Description check
-
Explanation
The description explains the backlog problem and the concurrency and sweep-limit changes. It does not provide the required Scope and approval section, and it does not clearly document focused verification tests or their observed results.
Resolution
Add explicit Problem, Change, Scope and approval, and Verification sections. Provide the linked issue or maintainer approval, or explain why this focused fix is exempt. List the focused tests or manual checks that were run and their observed results, including anything not checked.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
The managed tunnel reaper stopped shrinking the idle-tunnel backlog. Since Oct 22 the down count has swung between 5.5k and 8.5k every day, and its daily peak keeps creeping up. 93% of sweeps hit the 100-deletes-per-sweep cap. That caps the reaper at 1,200 deletes an hour, which is about the rate new idle tunnels arrive.
This change allows up to 250 deletes per sweep and runs 8 at a time instead of 4. I took the sizing from production traces:
The two rotation tests used 100 as the limit; they now read the constant.
Once this is deployed, the backlog should drain to about 1k within a day. What remains is legacy tunnels inside their 7-day grace period, plus each sweep's new arrivals.
🤖 Generated with Claude Code (Claude Opus 5.5)