[PR #2612] [MERGED] [client] Cancel the context of wg watcher when the go routine exit #15402

Closed
opened 2026-08-05 03:07:34 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2612
Author: @pappz
Created: 9/17/2024
Status: Merged
Merged: 9/17/2024
Merged by: @mlsmaycon

Base: mainHead: relay/fix/wgwatcher-enable


📝 Commits (1)

  • fc3001a Cancel the context of wg watcher when the go routine exit

📊 Changes

2 files changed (+7 additions, -6 deletions)

View changed files

📝 client/internal/peer/conn.go (+2 -2)
📝 client/internal/peer/worker_relay.go (+5 -4)

📄 Description

Describe your changes

When enabling the WG watcher the code checks the context cancellation status. Unfortunately, we canceled it in the Disable function only but are required to cancel it when exit the watcher go routine.

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/2612 **Author:** [@pappz](https://github.com/pappz) **Created:** 9/17/2024 **Status:** ✅ Merged **Merged:** 9/17/2024 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `relay/fix/wgwatcher-enable` --- ### 📝 Commits (1) - [`fc3001a`](https://github.com/netbirdio/netbird/commit/fc3001a757c5e7b10fd42efc6ce8b9012637e7fe) Cancel the context of wg watcher when the go routine exit ### 📊 Changes **2 files changed** (+7 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/peer/conn.go` (+2 -2) 📝 `client/internal/peer/worker_relay.go` (+5 -4) </details> ### 📄 Description ## Describe your changes When enabling the WG watcher the code checks the context cancellation status. Unfortunately, we canceled it in the Disable function only but are required to cancel it when exit the watcher go routine. ## Issue ticket number and link ### 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 03:07:34 -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#15402