Skip to content
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

libnetwork: "cannot accept client connections" on shutdown #42969

Open
thaJeztah opened this issue Oct 26, 2021 · 0 comments
Open

libnetwork: "cannot accept client connections" on shutdown #42969

thaJeztah opened this issue Oct 26, 2021 · 0 comments

Comments

@thaJeztah
Copy link
Member

Not a critical issue, but when working on https://github.com/moby/moby/pull/42835/files#r713120315, I noticed that an error is printed on every shutdown of the daemon;

time="2021-09-21T12:55:04.290097255Z" level=info msg="API listen on /tmp/docker-integration/d9ac12b0678f4.sock"
time="2021-09-21T12:55:04.414946112Z" level=debug msg="Calling GET /_ping"
time="2021-09-21T12:55:04.415317278Z" level=debug msg="Calling GET /info"
time="2021-09-21T12:55:04.430754586Z" level=info msg="Got signal to reload configuration, reloading from: /etc/docker/daemon.json"
time="2021-09-21T12:55:04.431178648Z" level=debug msg="Reset Max Concurrent Downloads: 3"
time="2021-09-21T12:55:04.431201851Z" level=debug msg="Reset Max Concurrent Uploads: 5"
time="2021-09-21T12:55:04.431221426Z" level=debug msg="Reset Max Download Attempts: 5"
time="2021-09-21T12:55:04.432309643Z" level=info msg="Reloaded configuration: {\"storage-driver\":\"overlay2\",\"mtu\":1500,\"pidfile\":\"/go/src/github.com/docker/docker/bundles/test-integration-flaky/TestDaemonProxy/reload_sanitized/d9ac12b0678f4/docker.pid\",\"data-root\":\"/go/src/github.com/docker/docker/bundles/test-integration-flaky/TestDaemonProxy/reload_sanitized/d9ac12b0678f4/root\",\"exec-root\":\"/tmp/dxr/d9ac12b0678f4\",\"group\":\"docker\",\"deprecated-key-path\":\"/etc/docker/key.json\",\"max-concurrent-downloads\":3,\"max-concurrent-uploads\":5,\"max-download-attempts\":5,\"shutdown-timeout\":15,\"debug\":true,\"hosts\":[\"unix:///tmp/docker-integration/d9ac12b0678f4.sock\"],\"log-level\":\"info\",\"swarm-default-advertise-addr\":\"\",\"swarm-raft-heartbeat-tick\":0,\"swarm-raft-election-tick\":0,\"metrics-addr\":\"\",\"host-gateway-ip\":\"172.18.0.1\",\"log-driver\":\"json-file\",\"ip\":\"0.0.0.0\",\"icc\":true,\"iptables\":true,\"ip-forward\":true,\"ip-masq\":true,\"userland-proxy\":true,\"default-address-pools\":{\"Values\":null},\"network-control-plane-mtu\":1500,\"experimental\":false,\"containerd\":\"/var/run/docker/containerd/containerd.sock\",\"builder\":{\"GC\":{},\"Entitlements\":{}},\"containerd-namespace\":\"d9ac12b0678f4\",\"containerd-plugin-namespace\":\"d9ac12b0678f4p\",\"runtimes\":{\"io.containerd.runc.v2\":{\"path\":\"runc\"},\"io.containerd.runtime.v1.linux\":{\"path\":\"runc\"},\"runc\":{\"path\":\"runc\"}},\"default-runtime\":\"runc\",\"seccomp-profile\":\"builtin\",\"default-shm-size\":67108864,\"default-ipc-mode\":\"private\",\"default-cgroupns-mode\":\"host\",\"resolv-conf\":\"/etc/resolv.conf\",\"http-proxy\":\"https://xxxxx:xxxxx@example.org\",\"https-proxy\":\"https://xxxxx:xxxxx@example.org\",\"no-proxy\":\"example.com\"}"
time="2021-09-21T12:55:04.435328719Z" level=info msg="Processing signal 'interrupt'"
time="2021-09-21T12:55:04.435439253Z" level=debug msg="daemon configured with a 15 seconds minimum shutdown timeout"
time="2021-09-21T12:55:04.435514624Z" level=debug msg="start clean shutdown of all containers with a 15 seconds timeout..."
time="2021-09-21T12:55:04.435590112Z" level=debug msg="found 0 orphan layers"
time="2021-09-21T12:55:04.437848674Z" level=debug msg="Unix socket /tmp/dxr/d9ac12b0678f4/libnetwork/f7725651065a.sock doesn't exist. cannot accept client connections"
time="2021-09-21T12:55:04.437938435Z" level=debug msg="Cleaning up old mountid : start."
time="2021-09-21T12:55:04.439961024Z" level=debug msg="Cleaning up old mountid : done."
time="2021-09-21T12:55:04.444201003Z" level=debug msg="Clean shutdown succeeded"
time="2021-09-21T12:55:04.444236880Z" level=info msg="Daemon shutdown complete"

Checking logs of that test-run, it looks to be occurring in all tests that shutdown the daemon (running within the bundles top level directory);

grep -lr 'cannot accept client connections' . | wc -l
     419

The error is produced in controller.acceptClientConnections

func (c *controller) acceptClientConnections(sock string, l net.Listener) {
for {
conn, err := l.Accept()
if err != nil {
if _, err1 := os.Stat(sock); os.IsNotExist(err1) {
logrus.Debugf("Unix socket %s doesn't exist. cannot accept client connections", sock)

Which is called by controller.startExternalKeyListener(), which is called by libnetwork/New(), which is called by daemon.initNetworkController(), which is called by daemon.restore() (need to follow the code further where that's called)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant