[PR #668] [MERGED] graceful shutdown fix #1562

Closed
opened 2025-12-29 02:30:35 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/668
Author: @GrigoriyMikhalkin
Created: 6/30/2022
Status: Merged
Merged: 7/22/2022
Merged by: @juanfont

Base: mainHead: graceful-shutdown


📝 Commits (5)

  • 889eff2 graceful shutdown fix
  • 3f0639c graceful shutdown lint fixes
  • 395caaa decompose OIDCCallback method
  • 56858a5 Revert "decompose OIDCCallback method"
  • 7c87ef6 Merge branch 'main' into graceful-shutdown

📊 Changes

3 files changed (+42 additions, -19 deletions)

View changed files

📝 app.go (+30 -15)
📝 config.go (+9 -4)
📝 poll.go (+3 -0)

📄 Description

There's few problems with a graceful shutdown that i tried to fix with this PR.

  1. shutdownChan channel that was used to finish PollNetMapStream didn't work if no PollNetMapStream was running at the time of shutdown. Also, it could stop only single PollNetMapStream routine, as single value was passed to channel instead of closing it.
  2. There is a race condition with function that handles termination signals, as it isn't included in an error group.

🔄 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/668 **Author:** [@GrigoriyMikhalkin](https://github.com/GrigoriyMikhalkin) **Created:** 6/30/2022 **Status:** ✅ Merged **Merged:** 7/22/2022 **Merged by:** [@juanfont](https://github.com/juanfont) **Base:** `main` ← **Head:** `graceful-shutdown` --- ### 📝 Commits (5) - [`889eff2`](https://github.com/juanfont/headscale/commit/889eff265fdcaff348c406270666fa3067194559) graceful shutdown fix - [`3f0639c`](https://github.com/juanfont/headscale/commit/3f0639c87ddbb86fd9af3d210eafa98b80301ad1) graceful shutdown lint fixes - [`395caaa`](https://github.com/juanfont/headscale/commit/395caaad421797ac7fba6a0ca0e7df87d13262f2) decompose OIDCCallback method - [`56858a5`](https://github.com/juanfont/headscale/commit/56858a56dbd50cc1c0547542a0b78948318e0f30) Revert "decompose OIDCCallback method" - [`7c87ef6`](https://github.com/juanfont/headscale/commit/7c87ef6c867fb0c1642e1548a3cccba9b29dee1e) Merge branch 'main' into graceful-shutdown ### 📊 Changes **3 files changed** (+42 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `app.go` (+30 -15) 📝 `config.go` (+9 -4) 📝 `poll.go` (+3 -0) </details> ### 📄 Description There's few problems with a graceful shutdown that i tried to fix with this PR. 1. `shutdownChan` channel that was used to finish `PollNetMapStream` didn't work if no `PollNetMapStream` was running at the time of shutdown. Also, it could stop only single `PollNetMapStream` routine, as single value was passed to channel instead of closing it. 2. There is a race condition with function that handles termination signals, as it isn't included in an error group. --- <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 02:30:35 +01:00
adam closed this issue 2025-12-29 02:30:35 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1562