-
Notifications
You must be signed in to change notification settings - Fork 881
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
Fix for problem where agent is stopped and does not restart #2307
Conversation
Please sign your commits following these rules: $ git clone -b "fix-agent-init-problem" git@github.com:kylewuolle/libnetwork.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f Amending updates the existing PR. You DO NOT need to open a new one. |
e52c790
to
918fcaf
Compare
ping @fcrisciani @euank ptal |
whoops, wrong Euan. Meant @euanh 😊 |
fa3358b
to
42da117
Compare
Can you pls fix below error |
ping @fcrisciani @euanh! |
controller.go
Outdated
@@ -268,7 +268,7 @@ func (c *controller) SetClusterProvider(provider cluster.Provider) { | |||
} | |||
c.Unlock() | |||
|
|||
if provider == nil || sameProvider { | |||
if provider == nil || (sameProvider && c.getAgent() != nil) { |
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.
if I understood well, basically when the node leave the cluster never reset the cluster provider. If so, I will find much better to just reset the cluster provider to nil when the node leave the cluster.
That way sameProvider will be false and the init will continue. What do you think? is it my understanding correct?
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.
That might work as well. I'll test it out and see!
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.
Thanks!
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.
Not sure if you review moby or not but I've made a PR over there that fixes it in a different way.
moby/moby#38626
@kylewuolle if you can rebase I have fixed that lint failure. |
Will do thanks! It does for sure fix the issue! |
Signed-off-by: Kyle Wuolle <kyle.wuolle@gmail.com>
35f6aa3
to
c7125bd
Compare
All done thanks! |
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.
LGTM Thanks!
@thaJeztah to which branch do we need this one to go? |
full diff: moby/libnetwork@1a06131...ebcade7 relevant changes: - moby/libnetwork#2349 IPVS: Add support for GetConfig/SetConfig - moby/libnetwork#2343 Revert "debian has iptables-legacy and iptables-nft now" - moby/libnetwork#2230 Moving IPVLAN driver out of experimental - moby/libnetwork#2307 Fix for problem where agent is stopped and does not restart - moby/libnetwork#2303 Touch-up error-message and godoc for ConfigVXLANUDPPort - moby/libnetwork#2325 Fix possible nil pointer exception - moby/libnetwork#2302 Use sync.RWMutex for VXLANUDPPort - moby/libnetwork#2306 Improve error if auto-selecting IP-range failed Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: moby/libnetwork@1a06131...ebcade7 relevant changes: - moby/libnetwork#2349 IPVS: Add support for GetConfig/SetConfig - moby/libnetwork#2343 Revert "debian has iptables-legacy and iptables-nft now" - moby/libnetwork#2230 Moving IPVLAN driver out of experimental - moby/libnetwork#2307 Fix for problem where agent is stopped and does not restart - moby/libnetwork#2303 Touch-up error-message and godoc for ConfigVXLANUDPPort - moby/libnetwork#2325 Fix possible nil pointer exception - moby/libnetwork#2302 Use sync.RWMutex for VXLANUDPPort - moby/libnetwork#2306 Improve error if auto-selecting IP-range failed Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 3ab093d5670e8d59f6ae0c4604b8fcabf1582854 Component: engine
full diff: moby/libnetwork@1a06131...ebcade7 relevant changes: - moby/libnetwork#2349 IPVS: Add support for GetConfig/SetConfig - moby/libnetwork#2343 Revert "debian has iptables-legacy and iptables-nft now" - moby/libnetwork#2230 Moving IPVLAN driver out of experimental - moby/libnetwork#2307 Fix for problem where agent is stopped and does not restart - moby/libnetwork#2303 Touch-up error-message and godoc for ConfigVXLANUDPPort - moby/libnetwork#2325 Fix possible nil pointer exception - moby/libnetwork#2302 Use sync.RWMutex for VXLANUDPPort - moby/libnetwork#2306 Improve error if auto-selecting IP-range failed Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: moby/libnetwork@c902989...872f0a8 - moby/libnetwork#2354 [18.09 backport] Cleanup the cluster provider when the agent is closed - backport of moby/libnetwork#2307 Fix for problem where agent is stopped and does not restart - fixes docker/for-linux#495 Docker swarm overlay networking not working after --force-new-cluster - moby/libnetwork#2369 [18.09 BACKPORT] Pick a random host port if the user does not specify a host port - backport of moby/libnetwork#2368 (windows) Pick a random host port if the user does not specify a host port Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
full diff: moby/libnetwork@c902989...872f0a8 - moby/libnetwork#2354 [18.09 backport] Cleanup the cluster provider when the agent is closed - backport of moby/libnetwork#2307 Fix for problem where agent is stopped and does not restart - fixes docker/for-linux#495 Docker swarm overlay networking not working after --force-new-cluster - moby/libnetwork#2369 [18.09 BACKPORT] Pick a random host port if the user does not specify a host port - backport of moby/libnetwork#2368 (windows) Pick a random host port if the user does not specify a host port Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 5354408039681020f9ad6afe4bf696fc90f9ce69 Component: engine
full diff: moby/libnetwork@1a06131...ebcade7 relevant changes: - moby/libnetwork#2349 IPVS: Add support for GetConfig/SetConfig - moby/libnetwork#2343 Revert "debian has iptables-legacy and iptables-nft now" - moby/libnetwork#2230 Moving IPVLAN driver out of experimental - moby/libnetwork#2307 Fix for problem where agent is stopped and does not restart - moby/libnetwork#2303 Touch-up error-message and godoc for ConfigVXLANUDPPort - moby/libnetwork#2325 Fix possible nil pointer exception - moby/libnetwork#2302 Use sync.RWMutex for VXLANUDPPort - moby/libnetwork#2306 Improve error if auto-selecting IP-range failed Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This fixes a problem where the agent on a controller is stopped when a node leaves a swarm and is never restarted. By adding a check to see if the agent is nil the agent init routine will run and the other checks that guard against multiple agents will still function as intended. Here's some more information about how this problem presents itself docker/for-linux#495.