From b4d8c26194eb7d51d01cc9a9f604919f6ee36357 Mon Sep 17 00:00:00 2001 From: Frank Schroeder Date: Thu, 26 Oct 2017 12:14:19 +0200 Subject: [PATCH] docker: add comment about "connection reset by peer" error --- agent/checks/docker.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/agent/checks/docker.go b/agent/checks/docker.go index c703cb0cb5..3644a68525 100644 --- a/agent/checks/docker.go +++ b/agent/checks/docker.go @@ -162,6 +162,12 @@ func (c *DockerClient) StartExec(containerID, execID string) (*circbuf.Buffer, e uri := fmt.Sprintf("/exec/%s/start", execID) b, code, err := c.call("POST", uri, data) switch { + // todo(fs): https://github.com/hashicorp/consul/pull/3621 + // todo(fs): for some reason the docker agent closes the connection during the + // todo(fs): io.Copy call in c.call which causes a "connection reset by peer" error + // todo(fs): even though both body and status code have been received. My current is + // todo(fs): that the docker agent closes this prematurely but I don't understand why. + // todo(fs): the code below ignores this error. case err != nil && !strings.Contains(err.Error(), "connection reset by peer"): return nil, fmt.Errorf("start exec failed for container %s: %s", containerID, err) case code == 200: