From 3df00a6c647117b894961f63cd61c52b2c55f4e0 Mon Sep 17 00:00:00 2001 From: Chris Telfer Date: Thu, 26 Apr 2018 10:19:26 -0400 Subject: [PATCH] Add wait time into xtables lock warning Signed-off-by: Chris Telfer --- libnetwork/iptables/iptables.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libnetwork/iptables/iptables.go b/libnetwork/iptables/iptables.go index fa5d871086..50896d935a 100644 --- a/libnetwork/iptables/iptables.go +++ b/libnetwork/iptables/iptables.go @@ -430,8 +430,9 @@ const opWarnTime = 2 * time.Second func filterOutput(start time.Time, output []byte, args ...string) []byte { // Flag operations that have taken a long time to complete - if time.Since(start) > opWarnTime { - logrus.Warnf("xtables contention detected while running [%s]: %q", strings.Join(args, " "), string(output)) + opTime := time.Since(start) + if opTime > opWarnTime { + logrus.Warnf("xtables contention detected while running [%s]: Waited for %.2f seconds and received %q", strings.Join(args, " "), float64(opTime)/float64(time.Second), string(output)) } // ignore iptables' message about xtables lock: // it is a warning, not an error.