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

Simplify update logic #142

Merged
merged 9 commits into from
Oct 7, 2021
Merged

Simplify update logic #142

merged 9 commits into from
Oct 7, 2021

Conversation

kradalby
Copy link
Collaborator

@kradalby kradalby commented Oct 5, 2021

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

There is some weird behaviour that seem to storm the update channel. And
our solution with a central map of update channels isnt particularly
elegant.

For now, replace all the complicated stuff with a simple channel that
checks roughly every 10s if the node is up to date. Only generate and
update if there has been changes.
@kradalby kradalby marked this pull request as ready for review October 6, 2021 07:13
@kradalby kradalby requested a review from juanfont October 6, 2021 07:34
@kradalby kradalby mentioned this pull request Oct 6, 2021
@kradalby
Copy link
Collaborator Author

kradalby commented Oct 6, 2021

Fixes #97

app.go Show resolved Hide resolved
}
}
h.setLastStateChangeToNow(ns.Name)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this enough for the shared nodes? This does not trigger an update to the namespaces where this node is shares...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I believe I have addressed it in the last commit.

@kradalby kradalby requested a review from juanfont October 6, 2021 19:57
@@ -10,6 +10,7 @@ require (
github.com/docker/cli v20.10.8+incompatible // indirect
github.com/docker/docker v20.10.8+incompatible // indirect
github.com/efekarakus/termcolor v1.0.1
github.com/fatih/set v0.2.1 // indirect
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lel

machine.go Show resolved Hide resolved
@kradalby kradalby merged commit fd8d888 into juanfont:main Oct 7, 2021
@kradalby kradalby deleted the loopy-loop branch October 7, 2021 15:25
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.

2 participants