mirror of https://github.com/k3s-io/k3s
Should not defer conn.Close when leaking the connection
parent
a06fc6ab7a
commit
938430b1eb
|
@ -36,7 +36,8 @@ import (
|
|||
"k8s.io/kubernetes/test/images/net/common"
|
||||
)
|
||||
|
||||
// leakedConnection is a
|
||||
// leakedConnection is a global variable that should leak the active
|
||||
// connection assigned here.
|
||||
var leakedConnection *net.TCPConn
|
||||
|
||||
// Server JSON options.
|
||||
|
@ -156,7 +157,9 @@ func (client *closeWaitClient) Run(logger *log.Logger, rawOptions interface{}) e
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer conn.Close()
|
||||
if !client.options.LeakConnection {
|
||||
defer conn.Close()
|
||||
}
|
||||
|
||||
logger.Printf("Connected to server")
|
||||
|
||||
|
|
Loading…
Reference in New Issue