diff --git a/command/agent/alloc_endpoint.go b/command/agent/alloc_endpoint.go index 208651448..e8eda6025 100644 --- a/command/agent/alloc_endpoint.go +++ b/command/agent/alloc_endpoint.go @@ -556,10 +556,14 @@ func (s *HTTPServer) execStreamImpl(ws *websocket.Conn, args *cstructs.AllocExec handler(handlerPipe) // stop streaming background goroutines for streaming - but not websocket activity cancel() - // retreieve any error and/or wait until goroutine stop and close errCh connection before + // retrieve any error and/or wait until goroutine stop and close errCh connection before // closing websocket connection codedErr := <-errCh + // we won't return an error on ws close, but at least make it available in + // the logs so we can trace spurious disconnects + s.logger.Debug("alloc exec channel closed with error", "error", codedErr) + if isClosedError(codedErr) { codedErr = nil } else if codedErr != nil {