Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adaptive longOp for du operation #1766

Merged
merged 1 commit into from
Oct 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions container/common/fsHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ type realFsHandler struct {
}

const (
longOp = time.Second
timeout = 2 * time.Minute
maxBackoffFactor = 20
)
Expand Down Expand Up @@ -111,6 +110,7 @@ func (fh *realFsHandler) update() error {

func (fh *realFsHandler) trackUsage() {
fh.update()
longOp := time.Second
for {
select {
case <-fh.stopChan:
Expand All @@ -128,7 +128,11 @@ func (fh *realFsHandler) trackUsage() {
}
duration := time.Since(start)
if duration > longOp {
glog.V(2).Infof("du and find on following dirs took %v: %v", duration, []string{fh.rootfs, fh.extraDir})
// adapt longOp time so that message doesn't continue to print
// if the long duration is persistent either because of slow
// disk or lots of containers.
longOp = longOp + time.Second
glog.V(2).Infof("du and find on following dirs took %v: %v; will not log again for this container unless duration exceeds %d seconds.", duration, []string{fh.rootfs, fh.extraDir}, longOp)
}
}
}
Expand Down