[PR #2125] [MERGED] make stream shutdown if self-node has been removed #2513

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2125
Author: @kradalby
Created: 9/11/2024
Status: Merged
Merged: 9/11/2024
Merged by: @kradalby

Base: mainHead: kradalby/2118-panic-online-delete


📝 Commits (3)

  • 921c65f add shutdown that asserts if headscale had panics
  • cac0ff3 add test case producing 2118 panic
  • eb71f8a make stream shutdown if self-node has been removed

📊 Changes

8 files changed (+148 additions, -21 deletions)

View changed files

📝 .github/workflows/test-integration.yaml (+1 -0)
📝 hscontrol/poll.go (+7 -0)
📝 integration/control.go (+2 -2)
📝 integration/dockertestutil/logs.go (+10 -8)
📝 integration/general_test.go (+99 -0)
📝 integration/hsic/hsic.go (+4 -4)
📝 integration/scenario.go (+22 -6)
📝 integration/tsic/tsic.go (+3 -1)

📄 Description

Currently we will read the node from database, and since it is
deleted, the id might be set to nil. Keep the node around and
just shutdown, so it is cleanly removed from notifier.

Fixes https://github.com/juanfont/headscale/issues/2118

Also adds the ability to check integration test headscale for panics
and a test case producing the error, which is then fixed.

Signed-off-by: Kristoffer Dalby kristoffer@tailscale.com

Summary by CodeRabbit

  • New Features

    • Introduced a new test case to validate the deletion of an online node, enhancing system robustness.
    • Enhanced logging capabilities during shutdown processes, providing paths to log files for better diagnostics.
  • Bug Fixes

    • Improved error handling and logging during node removal and shutdown operations to prevent system panics.
  • Documentation

    • Added comments to indicate future enhancements regarding panic log assertions.

🔄 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/2125 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 9/11/2024 **Status:** ✅ Merged **Merged:** 9/11/2024 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `kradalby/2118-panic-online-delete` --- ### 📝 Commits (3) - [`921c65f`](https://github.com/juanfont/headscale/commit/921c65f91e9411f7ec56efddfa5ebffd67b90e37) add shutdown that asserts if headscale had panics - [`cac0ff3`](https://github.com/juanfont/headscale/commit/cac0ff3444b6227fc528554397dbb2af6ed6540d) add test case producing 2118 panic - [`eb71f8a`](https://github.com/juanfont/headscale/commit/eb71f8a9c12629c9e271d66124aed6d45a71c35f) make stream shutdown if self-node has been removed ### 📊 Changes **8 files changed** (+148 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test-integration.yaml` (+1 -0) 📝 `hscontrol/poll.go` (+7 -0) 📝 `integration/control.go` (+2 -2) 📝 `integration/dockertestutil/logs.go` (+10 -8) 📝 `integration/general_test.go` (+99 -0) 📝 `integration/hsic/hsic.go` (+4 -4) 📝 `integration/scenario.go` (+22 -6) 📝 `integration/tsic/tsic.go` (+3 -1) </details> ### 📄 Description Currently we will read the node from database, and since it is deleted, the id might be set to nil. Keep the node around and just shutdown, so it is cleanly removed from notifier. Fixes https://github.com/juanfont/headscale/issues/2118 Also adds the ability to check integration test headscale for panics and a test case producing the error, which is then fixed. Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new test case to validate the deletion of an online node, enhancing system robustness. - Enhanced logging capabilities during shutdown processes, providing paths to log files for better diagnostics. - **Bug Fixes** - Improved error handling and logging during node removal and shutdown operations to prevent system panics. - **Documentation** - Added comments to indicate future enhancements regarding panic log assertions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <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:21:36 +01:00
adam closed this issue 2025-12-29 03:21:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2513