-
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
Overlay network cannot accept containers on a newly provisioned machine after many network events have been triggered #1069
Comments
@JamieGarside Thanks for the issue report. Yes, Serf's user event buffer is limited. That is why we have the |
Thanks for replying @mrjana. The logs from both test machines are attached: test-1.txt (running nginx) I've done a quick grep over the files and can't find any matches for either "peer" or "query", so I'm assuming that the logging statements from both
I'm assuming this isn't a big problem though as these are on the machine running nginx, not the machine trying to resolve it. It does appear that query is never actually being fired though. I attached another Serf agent to test-1's Serf endpoint dumping events with this script:
Then starting Serf with |
@JamieGarside |
@JamieGarside I am able to recreate the issue. Thanks for reporting. The problem is because of a check in the L3 miss handling which inadvertently skips valid misses as well. |
Thanks for replicating and fixing @sanimej. In the meantime, we have a workaround for our case :) |
this will be fixed in 1.11.1 through moby/moby#22261 (which was just merged) |
I'm seeing issues where after a cluster using overlay networking has been running for a period of time, with many containers brought up and down, new machines added to the cluster cannot reliably communicate with existing containers running on other cluster machines.
As an example, if we spin up a cluster, then schedule a container we want to keep running (say, nginx), then add a new machine to the cluster after a period of time, it cannot communicate with the nginx container (and all attempts to communicate yield "Destination Host Unreachable"). If the nginx container is restarted however, containers running on the new machine can communicate successfully.
After a dig through, I'm thinking this is due to how memberships to the cluster are handled. When a machine is added to the cluster, it joins the existing Serf cluster and relays the containers/networks it knows about to the cluster (drivers/overlay/overlay.go:166-171). Of course, the new machine doesn't have any containers and thus nothing to relay. When joining Serf, the
ignoreOld
flag isfalse
(drivers/overlay/ov_serf.go:76) and as such, it gets an event replay from Serf, normally allowing it to reconstruct the state of the cluster.After a number of network events have been triggered though, the Serf replay log is truncated (currently at 1024 entries), and thus the new machine does not obtain any routing information for old containers running on existing machines in the cluster. After the old containers are restarted though, the routing information is again broadcast over Serf and hence propagates to the new machine, allowing it to communicate.
I've seen this happen using Docker 1.10.x on stock installs of Debian 8, Ubuntu 14.04LTS and Boot2Docker 1.10.3 as provisioned using docker-machine. The below script gives us a reproducible test case:
I expect that the final command should ping the host successfully, but instead, ping simply responds with "Destination Host Unreachable", although correctly resolves the target address:
After restarting the nginx container, the ping is successful.
I've not seen any other reports of this from a search around, although #962 appears to be quite similar. I'm also not 100% convinced that I've got a full picture of what's going on (does the
resolvePeer
function resolve just a Serf partner, or should it attempt to resolve a container running elsewhere in the cluster?), but it appears that on all my tests, the machine joining the cluster is relying upon Serf's event replay to figure out what the state of the cluster is.The text was updated successfully, but these errors were encountered: