mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 06:15:45 +00:00
Should not defer conn.Close when leaking the connection
This commit is contained in:
parent
a06fc6ab7a
commit
938430b1eb
@ -36,7 +36,8 @@ import (
|
|||||||
"k8s.io/kubernetes/test/images/net/common"
|
"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
|
var leakedConnection *net.TCPConn
|
||||||
|
|
||||||
// Server JSON options.
|
// Server JSON options.
|
||||||
@ -156,7 +157,9 @@ func (client *closeWaitClient) Run(logger *log.Logger, rawOptions interface{}) e
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if !client.options.LeakConnection {
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
}
|
||||||
|
|
||||||
logger.Printf("Connected to server")
|
logger.Printf("Connected to server")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user