mirror of https://github.com/jackc/pgx.git
Fix: close conn on read failure in pipeline
Suggested by @jameshartig in https://github.com/jackc/pgx/issues/1847pull/1856/head
parent
4c14caae07
commit
cbc5a7055f
|
@ -2117,7 +2117,8 @@ func (p *Pipeline) getResults() (results any, err error) {
|
|||
case *pgproto3.ParseComplete:
|
||||
peekedMsg, err := p.conn.peekMessage()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
p.conn.asyncClose()
|
||||
return nil, normalizeTimeoutError(p.ctx, err)
|
||||
}
|
||||
if _, ok := peekedMsg.(*pgproto3.ParameterDescription); ok {
|
||||
return p.getResultsPrepare()
|
||||
|
|
Loading…
Reference in New Issue