[PR #63] [MERGED] Added communication between Serve and CLI using KV table #1233

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/63
Author: @juanfont
Created: 7/25/2021
Status: Merged
Merged: 8/3/2021
Merged by: @juanfont

Base: mainHead: use-kv-for-updates


📝 Commits (2)

  • 97f7c90 Added communication between Serve and CLI using KV table (helps in #52)
  • 461a893 Added log message when sending updates

📊 Changes

5 files changed (+119 additions, -2 deletions)

View changed files

📝 app.go (+17 -0)
📝 db.go (+2 -0)
📝 machine.go (+5 -2)
📝 machine_test.go (+11 -0)
📝 namespaces.go (+84 -0)

📄 Description

The in-memory clientsPolling map is only available from the Headscale process serving the API. This means that some changes performed by the CLI (which is a different process) are not propagated immediately to the polling clients.

This is what is happening in #52. Nodes are successfully removed from the DB, but the connected machines do not receive an updated node Map until their client decides to close the long poll and reconnect.

I have added a new worker that polls the KV table we had since the beginning in Headscale DB schema. Namespaces whose nodes should be sent an updated map are added to the namespaces_pending_updates key.

The hardcoded polling time is 5000 msecs.


🔄 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/63 **Author:** [@juanfont](https://github.com/juanfont) **Created:** 7/25/2021 **Status:** ✅ Merged **Merged:** 8/3/2021 **Merged by:** [@juanfont](https://github.com/juanfont) **Base:** `main` ← **Head:** `use-kv-for-updates` --- ### 📝 Commits (2) - [`97f7c90`](https://github.com/juanfont/headscale/commit/97f7c9009290566a9870580750bf495587906491) Added communication between Serve and CLI using KV table (helps in #52) - [`461a893`](https://github.com/juanfont/headscale/commit/461a893ee44349540bc2e4bb3e76154ff23cbc68) Added log message when sending updates ### 📊 Changes **5 files changed** (+119 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `app.go` (+17 -0) 📝 `db.go` (+2 -0) 📝 `machine.go` (+5 -2) 📝 `machine_test.go` (+11 -0) 📝 `namespaces.go` (+84 -0) </details> ### 📄 Description The in-memory `clientsPolling` map is only available from the Headscale process serving the API. This means that some changes performed by the CLI (which is a different process) are not propagated immediately to the polling clients. This is what is happening in #52. Nodes are successfully removed from the DB, but the connected machines do not receive an updated node `Map` until their client decides to close the long poll and reconnect. I have added a new worker that polls the KV table we had since the beginning in Headscale DB schema. Namespaces whose nodes should be sent an updated map are added to the `namespaces_pending_updates` key. The hardcoded polling time is 5000 msecs. --- <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:18 +01:00
adam closed this issue 2025-12-29 02:29:18 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1233