-
Notifications
You must be signed in to change notification settings - Fork 670
containers fail to start correctly when networking options are passed on start #1258
Comments
The issue can be reproduced via the API, not the CLI. It's not Kubernetes specific as such, IMO. |
Apparently, If so, the proxy will need to cope with everything in HostConfig being specified in |
Actually, it's pretty clear from reading |
I have traced docker and it's children, here is the output filtered for one of the hanging |
I have looked at the docs, one should set channel size to 1:
but We do have this in other places already as well
|
According to the signal.Notify docs,
I am baffled that it says I am worried about another race though... what if the proxy manages to send the signal to the weavewait process before that has invoked Even then though, I would have thought that it is extremely unlikely to hit that case. weavewait should reach the |
I can see that initial test was a false-positive, I'm afraid. Sounds like proxy sending the signal too soon is most likely. Looking at the gist I can see two |
would be good to get a trace with timings. |
certainly looks like the SIGUSR2 arrives very shortly after the /w/w exec. This is mysterious. Can scheduling really be so extreme to produce such outcomes regularly? |
does this happen under load, e.g. are there perhaps lots of containers starting simultaneously? |
I suspect #1210 would improve this, as it doesn't rely on intercepting the start request to attach the network. |
Yes, it occurs when ~10 containers are being started on a potentially overcommitted VM... |
Ok, so perhaps the race I described in #1258 (comment) can indeed occur then. That's a tricky one to fix. The following sequence would improve matters:
The problem then is that SIGUSR2 might get delivered to the application process. Perhaps we should go back to just checking for "ethwe up" in a loop. Or find a way to be notified when the interface comes up. netlink. sigh. That would also address #1209. |
The proposed fix to #1300 - going back waiting for the interface to come up, instead of waiting for a signal - will also fix this issue's original problem of containers getting started with different network settings than they were created with, provided that the new network settings are something like "container:otherContainer", where otherContainer has an ethwe interface. That's what I'd expect kubernetes to do, but my reading of their code does not reflect that - afaict the container is started with a network mode of "" or "host". I suspect I've missed something. |
|
Based on this, I don't immediately see why they couldn't pass those options to the container create instead of the start. |
correct. |
It's too intrusive a change for 1.0.2. |
It turns out that the version 1.18 of Docker remote API allows
HostConfig
attribute to be set when starting a container and, moreover, Kubernetes actually happens to use it.I have added a few of debug message to the proxy like this
and below is what I got.
we just create a container is expecting it to be wanting attached to weave
we are now about to start it
so now we are actually getting the
HostConfig.NetworkMode
passed in, hence the container is actually being ignored. However,/w/w
is already there and waits forSIGUSR2
...The entry point was meant to be
/entrypoint.sh redis-server
, which is expect to turn intoredis-server
process, instead this is what appears in the process tableThe text was updated successfully, but these errors were encountered: