Skip to content

Commit 29f418d

Browse files
pohlyialidzhikov
authored andcommitted
connection: exit with less output on connection loss
klog.Fatal dumps information about all running goroutines when the connection to the CSI driver is lost. Loosing the connection is normal and depends on the order in which containers are shut down. If it happens, then the reason is unlikely to be related to goroutines. Therefore this extra output is not helpful or worse, fills up logfiles when a sidecar has many goroutines, as in the external-provisioner which runs 100 workers by default.
1 parent 1ddd41d commit 29f418d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

connection/connection.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ func ExitOnConnectionLoss() func() bool {
8484
if err := ioutil.WriteFile(terminationLogPath, []byte(terminationMsg), 0644); err != nil {
8585
klog.Errorf("%s: %s", terminationLogPath, err)
8686
}
87-
klog.Fatalf(terminationMsg)
87+
klog.Exit(terminationMsg)
88+
// Not reached.
8889
return false
8990
}
9091
}

0 commit comments

Comments
 (0)