Fix for problem where agent is stopped and does not restart#2307
Fix for problem where agent is stopped and does not restart#2307fcrisciani merged 1 commit intomoby:masterfrom
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 -fAmending 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
| c.Unlock() | ||
|
|
||
| if provider == nil || sameProvider { | ||
| if provider == nil || (sameProvider && c.getAgent() != nil) { |
There was a problem hiding this comment.
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.
That might work as well. I'll test it out and see!
There was a problem hiding this comment.
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! |
|
@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
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.