Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 beforetunnels.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
belowtimers.connection_alive_interval
(5s) ortimers.pending_deletion_interval
(10s) would lead to possibly unexpected outcomes.