1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #2142 from ctelfer/xfilter-warn-timestamp

Add wait time into xtables lock warning
This commit is contained in:
Flavio Crisciani 2018-04-26 13:16:50 -07:00 committed by GitHub
commit 5c679b051d

View file

@ -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.