diff options
author | David Fifield <david@bamsoftware.com> | 2020-10-22 23:01:45 -0600 |
---|---|---|
committer | David Fifield <david@bamsoftware.com> | 2020-10-22 23:01:45 -0600 |
commit | 912bcae24eb71bc52c6f28b908e3c7678781e1a2 (patch) | |
tree | 24823787c6fc1dc7adaa93d3c6bcd0f84c5ec6ff | |
parent | 6baa3c4d5f70fd50223dc41febf67576267d039b (diff) | |
download | snowflake-912bcae24eb71bc52c6f28b908e3c7678781e1a2.tar.gz snowflake-912bcae24eb71bc52c6f28b908e3c7678781e1a2.zip |
Don't log io.ErrClosedPipe in proxy.
We expect one of these at the end of just about every proxy session, as
the Conns in both directions are closed as soon as the copy loop
finishes in one direction.
Closes #40016.
-rw-r--r-- | proxy/snowflake.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/proxy/snowflake.go b/proxy/snowflake.go index ac85527..96851ae 100644 --- a/proxy/snowflake.go +++ b/proxy/snowflake.go @@ -300,7 +300,9 @@ func CopyLoop(c1 io.ReadWriteCloser, c2 io.ReadWriteCloser) { var wg sync.WaitGroup copyer := func(dst io.ReadWriteCloser, src io.ReadWriteCloser) { defer wg.Done() - if _, err := io.Copy(dst, src); err != nil { + // Ignore io.ErrClosedPipe because it is likely caused by the + // termination of copyer in the other direction. + if _, err := io.Copy(dst, src); err != nil && err != io.ErrClosedPipe { log.Printf("io.Copy inside CopyLoop generated an error: %v", err) } dst.Close() |