[PR #3801] [MERGED] Feature/lazy connection fix inactivity #21539

Open
opened 2026-08-05 05:08:38 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/3801
Author: @pappz
Created: 5/7/2025
Status: Merged
Merged: 5/8/2025
Merged by: @pappz

Base: feature/lazy-connectionHead: feature/lazy-connection-fix-inactivity


📝 Commits (2)

  • 0baee6d Fix exclude list handling
  • 3e0f588 Start inactivity monitor when the remote peer initiate the connection

📊 Changes

4 files changed (+25 additions, -11 deletions)

View changed files

📝 client/internal/conn_mgr.go (+3 -2)
📝 client/internal/engine.go (+5 -4)
📝 client/internal/lazyconn/inactivity/inactivity.go (+1 -0)
📝 client/internal/lazyconn/manager/manager.go (+16 -5)

📄 Description

Describe your changes

  • fix idle state managmenet
  • Validate the threshold env variable

If the remote peer initiates the connection, we just reset the inactivity listener, but do not start it. As a result, after a disconnection, our peer never switches back to the idle state.

For every peer, we instantiate an inactivity listener. It is a reusable timer, but it must start on a go routine after it has been stopped. The key challenge is to ensure that we never start the timer multiple times and always clean it up properly when the peer is in the idle state or it has been set to the exclusion list.

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/3801 **Author:** [@pappz](https://github.com/pappz) **Created:** 5/7/2025 **Status:** ✅ Merged **Merged:** 5/8/2025 **Merged by:** [@pappz](https://github.com/pappz) **Base:** `feature/lazy-connection` ← **Head:** `feature/lazy-connection-fix-inactivity` --- ### 📝 Commits (2) - [`0baee6d`](https://github.com/netbirdio/netbird/commit/0baee6d83253a33f7a73247b3ea152bd2174ffec) Fix exclude list handling - [`3e0f588`](https://github.com/netbirdio/netbird/commit/3e0f588b52cb95468fb5e8619baf9846e9aa0706) Start inactivity monitor when the remote peer initiate the connection ### 📊 Changes **4 files changed** (+25 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/conn_mgr.go` (+3 -2) 📝 `client/internal/engine.go` (+5 -4) 📝 `client/internal/lazyconn/inactivity/inactivity.go` (+1 -0) 📝 `client/internal/lazyconn/manager/manager.go` (+16 -5) </details> ### 📄 Description ## Describe your changes - fix idle state managmenet - Validate the threshold env variable If the remote peer initiates the connection, we just reset the inactivity listener, but do not start it. As a result, after a disconnection, our peer never switches back to the idle state. For every peer, we instantiate an inactivity listener. It is a reusable timer, but it must start on a go routine after it has been stopped. The key challenge is to ensure that we never start the timer multiple times and always clean it up properly when the peer is in the idle state or it has been set to the exclusion list. ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 05:08:38 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#21539