Skip to content

Conversation

@michaelneale
Copy link
Collaborator

@michaelneale michaelneale commented Nov 26, 2025

there can be multiple goosed but should only be one tunnel running.

small one - would rather not need to do this, but as things are now, we let many goosed fly (pun intended) so as this is in process, don't really want to double up (not sure what would happen - probably nothing functionally good!)

Copilot AI review requested due to automatic review settings November 26, 2025 05:05
Copilot finished reviewing on behalf of michaelneale November 26, 2025 05:09
Copy link
Contributor

Copilot AI left a comment

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 implements file-based locking to ensure only one tunnel instance runs across multiple goose-server processes. The fix uses the fs2 crate for cross-process exclusive file locks, preventing duplicate tunnel instances from starting simultaneously.

Key changes:

  • Added fs2 dependency for cross-process file locking
  • Implemented lock acquisition/release functions with PID tracking
  • Integrated lock into TunnelManager lifecycle (acquire on start, release on stop/error)
  • Updated status reporting to detect tunnels running in other instances
  • Changed auto-start error logging from error to info level when lock is already held

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
crates/goose-server/src/tunnel/mod.rs Core implementation: adds lock acquisition/checking functions, integrates file lock into TunnelManager struct, updates start/stop to acquire/release lock, modifies status reporting to detect tunnels in other instances
crates/goose-server/Cargo.toml Adds fs2 0.4.3 dependency for file locking
Cargo.lock Updates lock file with fs2 dependency

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants