Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added communication between Serve and CLI using KV table #63

Merged
merged 2 commits into from
Aug 3, 2021

Conversation

juanfont
Copy link
Owner

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.

@juanfont juanfont requested a review from cure July 25, 2021 16:05
@juanfont juanfont mentioned this pull request Jul 25, 2021
@juanfont
Copy link
Owner Author

juanfont commented Aug 3, 2021

I am not 100% happy with this, as it looks a bit convoluted. But it works(tm).

@juanfont juanfont merged commit 6091373 into main Aug 3, 2021
@kradalby kradalby deleted the use-kv-for-updates branch August 26, 2021 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant