File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -567,8 +567,13 @@ final class PostgresChannelHandler: ChannelDuplexHandler {
567567 _ cleanup: ConnectionStateMachine . ConnectionAction . CleanUpContext ,
568568 context: ChannelHandlerContext
569569 ) {
570- self . logger. debug ( " Cleaning up and closing connection. " , metadata: [ . error: " \( cleanup. error) " ] )
571-
570+ // Don't log a misleading error if the client closed the connection.
571+ if cleanup. error. code == . clientClosedConnection {
572+ self . logger. debug ( " Cleaning up and closing connection. " )
573+ } else {
574+ self . logger. debug ( " Cleaning up and closing connection. " , metadata: [ . error: " \( cleanup. error) " ] )
575+ }
576+
572577 // 1. fail all tasks
573578 cleanup. tasks. forEach { task in
574579 task. failWithError ( cleanup. error)
You can’t perform that action at this time.
0 commit comments