Skip to content

Commit 1cfd639

Browse files
committed
adaptive longOp for du operation
1 parent b9ab5d6 commit 1cfd639

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

container/common/fsHandler.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ type realFsHandler struct {
5151
}
5252

5353
const (
54-
longOp = time.Second
5554
timeout = 2 * time.Minute
5655
maxBackoffFactor = 20
5756
)
@@ -111,6 +110,7 @@ func (fh *realFsHandler) update() error {
111110

112111
func (fh *realFsHandler) trackUsage() {
113112
fh.update()
113+
longOp := time.Second
114114
for {
115115
select {
116116
case <-fh.stopChan:
@@ -129,6 +129,10 @@ func (fh *realFsHandler) trackUsage() {
129129
duration := time.Since(start)
130130
if duration > longOp {
131131
glog.V(2).Infof("du and find on following dirs took %v: %v", duration, []string{fh.rootfs, fh.extraDir})
132+
// adapt longOp time so that message doesn't continue to print
133+
// if the long duration is persistent either because of slow
134+
// disk or lots of containers.
135+
longOp = longOp + time.Millisecond*100
132136
}
133137
}
134138
}

0 commit comments

Comments
 (0)