feat: restart tailscaled if it terminates or becomes unresponsive - #112
Conversation
Signed-off-by: Derek Kaser <11674153+dkaser@users.noreply.github.com>
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe watcher now checks Tailscale daemon health on each polling iteration. System helpers detect process absence or API unresponsiveness, recheck after 30 seconds, and restart Tailscale when the failure persists. ChangesTailscale watchdog recovery
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Watcher
participant System
participant tailscaled
participant rc.tailscale
Watcher->>System: run checkTailscale()
System->>tailscaled: check process and API status
tailscaled-->>System: status response or failure
System->>System: wait 30 seconds and recheck
System->>rc.tailscale: restart Tailscale when still unhealthy
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/usr/local/php/unraid-tailscale-utils/unraid-tailscale-utils/System.php`:
- Around line 150-153: Update the restart branch in System.php so it restarts
sshd after Utils::runwrap restarts Tailscale. Preserve the existing
isTailscaleRunning check and ensure the sshd restart occurs afterward to bind to
the new Tailscale interface/IP.
- Around line 132-139: Update the daemon health check in the surrounding status
method to inspect the object returned by LocalAPI::getStatus() and treat an
empty \stdClass as unresponsive, logging the existing message and returning
false. Remove the ineffective RuntimeException catch and the unused $status
handling while preserving true for non-empty status responses.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 42602390-d8e5-4816-8f29-aa4257bead36
📒 Files selected for processing (2)
src/usr/local/php/unraid-tailscale-utils/unraid-tailscale-utils/System.phpsrc/usr/local/php/unraid-tailscale-utils/unraid-tailscale-utils/Watcher.php
Signed-off-by: Derek Kaser <11674153+dkaser@users.noreply.github.com>
Closes #111
Summary by CodeRabbit