2
0

Make copyErrChan buffered so goroutine can always terminate

It is possible the goroutine that is reading from copyErrChan will not
read in case of error.
This commit is contained in:
Jack Christensen
2020-01-25 20:39:18 -06:00
parent 139342081e
commit 67f2418279
+1 -1
View File
@@ -1085,7 +1085,7 @@ func (pgConn *PgConn) CopyFrom(ctx context.Context, r io.Reader, sql string) (Co
// Send copy data
abortCopyChan := make(chan struct{})
copyErrChan := make(chan error)
copyErrChan := make(chan error, 1)
signalMessageChan := pgConn.signalMessage()
go func() {