From 11016a4b9d1de8a86d3b69346bd00dc1305cf34f Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 9 Feb 2021 14:18:43 +0100 Subject: [PATCH] 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. --- connection/connection.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/connection/connection.go b/connection/connection.go index ac07d59b..74292a02 100644 --- a/connection/connection.go +++ b/connection/connection.go @@ -84,7 +84,8 @@ func ExitOnConnectionLoss() func() bool { if err := ioutil.WriteFile(terminationLogPath, []byte(terminationMsg), 0644); err != nil { klog.Errorf("%s: %s", terminationLogPath, err) } - klog.Fatalf(terminationMsg) + klog.Exit(terminationMsg) + // Not reached. return false } }