Skip to content

fix rejoin error - #37

Merged
InftyAI-Agent merged 1 commit into
InftyAI:mainfrom
kerthcet:cleanup/solve-rejoin-error
Aug 4, 2026
Merged

fix rejoin error#37
InftyAI-Agent merged 1 commit into
InftyAI:mainfrom
kerthcet:cleanup/solve-rejoin-error

Conversation

@kerthcet

@kerthcet kerthcet commented Aug 4, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #

Special notes for your reviewer

Does this PR introduce a user-facing change?


Signed-off-by: kerthcet <kerthcet@gmail.com>
Copilot AI lite review requested due to automatic review settings August 4, 2026 12:39
@kerthcet

kerthcet commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

/lgtm
/kind bug

@InftyAI-Agent InftyAI-Agent added needs-triage Indicates an issue or PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. do-not-merge/needs-kind Indicates a PR lacks a label and requires one. approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Looks good to me, indicates that a PR is ready to be merged. bug Categorizes issue or PR as related to a bug. and removed do-not-merge/needs-kind Indicates a PR lacks a label and requires one. labels Aug 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves tunnel-mode resiliency by ensuring the Tailscale mesh is (re)established as part of each reconnect attempt, and adds license/notice documentation for the Tailscale dependency used in tunnel mode.

Changes:

  • Reworks tunnel mode flow so setup_tunnel() is called on every reconnect-loop iteration (and errors no longer crash the daemon).
  • Makes setup_tunnel() idempotent by only spawning tailscaled when not already running, while always re-running tailscale up.
  • Adds THIRD_PARTY_NOTICES.md and links it from the README to document third-party components (Tailscale).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
THIRD_PARTY_NOTICES.md Adds third-party licensing notice for Tailscale usage in tunnel mode.
sandd/src/main.rs Re-establishes tunnel on reconnect loop; makes setup_tunnel idempotent and more reconnect-friendly.
README.md Links to third-party notices from the License section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sandd/src/main.rs
Comment on lines +827 to +847
if tailscaled_running {
info!("tailscaled already running; re-joining mesh");
} else {
info!("Starting tailscaled...");
// --socks5-server is what makes tunnel mode actually work: with
// --tun=userspace-networking there is no TUN device and thus no kernel route
// to the tailnet (100.64.0.0/10), so a plain socket to the controller's mesh
// address always fails. The SOCKS5 proxy is the entry point INTO tailscaled's
// userspace network stack; connect_and_serve dials the controller through it
// (see TUNNEL_SOCKS_PROXY) so the WebSocket rides the mesh. Bound to localhost
// so only this container's daemon can use it.
Command::new("tailscaled")
.arg("--tun=userspace-networking")
.arg(format!("--socks5-server={}", TUNNEL_SOCKS_PROXY))
.arg("--state=/var/lib/tailscale/tailscaled.state")
.spawn()
.context("Failed to start tailscaled")?;

// Give tailscaled time to start
tokio::time::sleep(Duration::from_secs(2)).await;
}

@InftyAI-Agent InftyAI-Agent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: PR has both lgtm and approved labels

@InftyAI-Agent InftyAI-Agent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: PR has both lgtm and approved labels

@InftyAI-Agent
InftyAI-Agent merged commit 136febd into InftyAI:main Aug 4, 2026
41 of 44 checks passed
@kerthcet
kerthcet deleted the cleanup/solve-rejoin-error branch August 4, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. bug Categorizes issue or PR as related to a bug. lgtm Looks good to me, indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a label and requires one. needs-triage Indicates an issue or PR lacks a label and requires one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants