[PR #2536] [MERGED] Fix panic on fast reconnection of node #2712

Closed
opened 2025-12-29 03:22:27 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2536
Author: @qoke
Created: 4/16/2025
Status: Merged
Merged: 4/23/2025
Merged by: @kradalby

Base: mainHead: fix-reconnect-panic


📝 Commits (2)

  • 06185e5 Fix panic on fast reconnection of node
  • 1c79585 Use parameter captured in closure as per review request

📊 Changes

2 files changed (+103 additions, -3 deletions)

View changed files

📝 hscontrol/notifier/notifier.go (+25 -3)
📝 hscontrol/notifier/notifier_test.go (+78 -0)

📄 Description

Multiple goroutines calling AddNode and RemoveNode cause panics when trying to close a channel that was already closed, which can happen when a node changes network transport quickly (eg mobile->wifi) and reconnects whilst also disconnecting.

Added test and fix


🔄 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/juanfont/headscale/pull/2536 **Author:** [@qoke](https://github.com/qoke) **Created:** 4/16/2025 **Status:** ✅ Merged **Merged:** 4/23/2025 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `fix-reconnect-panic` --- ### 📝 Commits (2) - [`06185e5`](https://github.com/juanfont/headscale/commit/06185e5876743e2592a3fc0cbd3dc2d3d9b6cec7) Fix panic on fast reconnection of node - [`1c79585`](https://github.com/juanfont/headscale/commit/1c7958501a5a0ef57277cab42dab11e421f3372c) Use parameter captured in closure as per review request ### 📊 Changes **2 files changed** (+103 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `hscontrol/notifier/notifier.go` (+25 -3) 📝 `hscontrol/notifier/notifier_test.go` (+78 -0) </details> ### 📄 Description Multiple goroutines calling AddNode and RemoveNode cause panics when trying to close a channel that was already closed, which can happen when a node changes network transport quickly (eg mobile->wifi) and reconnects whilst also disconnecting. Added test and fix --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 03:22:27 +01:00
adam closed this issue 2025-12-29 03:22:27 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2712