[PR #142] [MERGED] Simplify update logic #1284

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/142
Author: @kradalby
Created: 10/5/2021
Status: Merged
Merged: 10/7/2021
Merged by: @kradalby

Base: mainHead: loopy-loop


📝 Commits (9)

  • 8abc757 Tear out all the complicated update logic
  • a01a0d1 Remove unstable update channel, replace with state updates
  • 722084f Comment out aggressive logging
  • c582c8d Update metrics for new code
  • ba391bc Account for updates in shared namespaces
  • 95f726f Fix logic
  • f0c5449 Allow multiple namespaces to be checked for state at the same time
  • e4f197b Merge branch 'main' into loopy-loop
  • 06f5641 Update machine.go

📊 Changes

8 files changed (+86 additions, -167 deletions)

View changed files

📝 api.go (+1 -1)
📝 app.go (+23 -12)
📝 go.mod (+1 -0)
📝 go.sum (+2 -0)
📝 machine.go (+21 -108)
📝 metrics.go (+5 -5)
📝 namespaces.go (+6 -13)
📝 poll.go (+27 -28)

📄 Description

This PR simplifies the update channel logic and tears out all the complicated (and extremely flaky) channel map trying to keep track of all the clients.

Instead of trying to manage notifies across the app, we will now check every 10s if a given client is up to date. If it is out of date and still has an open update channel, then generate and send an update.

This isn't the most elegant solution, but should work better than the current solution and address #97.

I will try to work on improving the "am I out of date" checks in the future.

Would appreciate if someone will help test this from the branch or from master before release. @busimus @jsiebens


🔄 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/142 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 10/5/2021 **Status:** ✅ Merged **Merged:** 10/7/2021 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `loopy-loop` --- ### 📝 Commits (9) - [`8abc757`](https://github.com/juanfont/headscale/commit/8abc7575cd7083060d19fb007dbf7117b2319738) Tear out all the complicated update logic - [`a01a0d1`](https://github.com/juanfont/headscale/commit/a01a0d103924348fc2f76cd6d2cea8b20f6d71bd) Remove unstable update channel, replace with state updates - [`722084f`](https://github.com/juanfont/headscale/commit/722084fbd36399b0dbc8d358d141b92b8f2e7fee) Comment out aggressive logging - [`c582c8d`](https://github.com/juanfont/headscale/commit/c582c8d206fb3212f9aa71fbd4f1d74f7a76b1ec) Update metrics for new code - [`ba391bc`](https://github.com/juanfont/headscale/commit/ba391bc2eda93cedf749f2242b0caa42a036ae71) Account for updates in shared namespaces - [`95f726f`](https://github.com/juanfont/headscale/commit/95f726fb31eed5d2430c8359a514796365a077d9) Fix logic - [`f0c5449`](https://github.com/juanfont/headscale/commit/f0c54490ed9f8deec835cf59a59c16780a4374fe) Allow multiple namespaces to be checked for state at the same time - [`e4f197b`](https://github.com/juanfont/headscale/commit/e4f197b709e6fc2ce29fb8b1ad5b2524cccd50bd) Merge branch 'main' into loopy-loop - [`06f5641`](https://github.com/juanfont/headscale/commit/06f56411dd040d26269273c8377880d86321ba14) Update machine.go ### 📊 Changes **8 files changed** (+86 additions, -167 deletions) <details> <summary>View changed files</summary> 📝 `api.go` (+1 -1) 📝 `app.go` (+23 -12) 📝 `go.mod` (+1 -0) 📝 `go.sum` (+2 -0) 📝 `machine.go` (+21 -108) 📝 `metrics.go` (+5 -5) 📝 `namespaces.go` (+6 -13) 📝 `poll.go` (+27 -28) </details> ### 📄 Description This PR simplifies the update channel logic and tears out all the complicated (and extremely flaky) channel map trying to keep track of all the clients. Instead of trying to manage notifies across the app, we will now check every 10s if a given client is up to date. If it is out of date and still has an open update channel, then generate and send an update. This isn't the most elegant solution, but should work better than the current solution and address #97. I will try to work on improving the "am I out of date" checks in the future. Would appreciate if someone will help test this from the branch or from master before release. @busimus @jsiebens --- <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:29:33 +01:00
adam closed this issue 2025-12-29 02:29:33 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1284