mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
pool: Clear connection before releasing
This to be consistent with other connection clean up handler as well as consul's https://github.com/hashicorp/consul/blob/v1.6.3/agent/pool/pool.go#L468-L479 .
This commit is contained in:
@@ -427,7 +427,6 @@ func (p *ConnPool) RPC(region string, addr net.Addr, version int, method string,
|
||||
err = msgpackrpc.CallWithCodec(sc.codec, method, args, reply)
|
||||
if err != nil {
|
||||
sc.Close()
|
||||
p.releaseConn(conn)
|
||||
|
||||
// If we read EOF, the session is toast. Clear it and open a
|
||||
// new session next time
|
||||
@@ -436,6 +435,8 @@ func (p *ConnPool) RPC(region string, addr net.Addr, version int, method string,
|
||||
p.clearConn(conn)
|
||||
}
|
||||
|
||||
p.releaseConn(conn)
|
||||
|
||||
// If the error is an RPC Coded error
|
||||
// return the coded error without wrapping
|
||||
if structs.IsErrRPCCoded(err) {
|
||||
|
||||
Reference in New Issue
Block a user