Skip to content

Drop inactive tunnels #1413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release-1.9
Choose a base branch
from
Open

Drop inactive tunnels #1413

wants to merge 1 commit into from

Conversation

nbrownus
Copy link
Collaborator

This PR enables nebula to close tunnels after a period of inactivity, it is not enabled by default but we should enable it in a future major/minor release. It also disables punchy from punching to lighthouses, which comes with some very narrow caveats which are detailed in the comments.

The original PoC is present in #1405

2 new config items are added, both are reload-able.

  • tunnels.drop_inactive - Enables or disables the feature, default is disabled (false) currently.
  • tunnels.inactivity_timeout - Determines the duration of inactivity before tunnels.drop_inactive is armed. Default is currently 10 minutes.

This is a rather large refactor because each state we wanted to track became map of all tunnel indexes with their own mutexes, those mutexes have caused problems in the past, and there isn't a compelling reason to have all that state stored in a single container. Instead, this stores a majority of the individual states on the HostInfo with less hot-path-blocking atomics.

These configs are not documented but setting tunnels.inactivity_timeout below timers.connection_alive_interval (5s) or timers.pending_deletion_interval (10s) would lead to possibly unexpected outcomes.

@nbrownus nbrownus force-pushed the remove-unused-tunnels branch from 5ed01d9 to 0708bd3 Compare May 23, 2025 04:22
@nbrownus nbrownus added smoke-test-extra Run extra smoke tests (freebsd, 32-bit, ipv4 only, etc) and removed smoke-test-extra Run extra smoke tests (freebsd, 32-bit, ipv4 only, etc) labels May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant