-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
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.
Fixes #97 |
} | ||
} | ||
h.setLastStateChangeToNow(ns.Name) |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lel
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