From eac66b67be0710322d0e21a67a55f5731be48f68 Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Wed, 8 Mar 2017 14:35:26 -0800 Subject: [PATCH] Remove aufs debugEBusy() Since it was introduced no reports were made and lsof seems to cause issues on some systems. Signed-off-by: Kenfe-Mickael Laventure --- daemon/graphdriver/aufs/aufs.go | 41 --------------------------------- 1 file changed, 41 deletions(-) diff --git a/daemon/graphdriver/aufs/aufs.go b/daemon/graphdriver/aufs/aufs.go index fb756cfa77..b85596278c 100644 --- a/daemon/graphdriver/aufs/aufs.go +++ b/daemon/graphdriver/aufs/aufs.go @@ -272,39 +272,6 @@ func (a *Driver) createDirsFor(id string) error { return nil } -// Helper function to debug EBUSY errors on remove. -func debugEBusy(mountPath string) (out []string, err error) { - // lsof is not part of GNU coreutils. This is a best effort - // attempt to detect offending processes. - c := exec.Command("lsof") - - r, err := c.StdoutPipe() - if err != nil { - return nil, fmt.Errorf("Assigning pipes failed with %v", err) - } - - if err := c.Start(); err != nil { - return nil, fmt.Errorf("Starting %s failed with %v", c.Path, err) - } - - defer func() { - waiterr := c.Wait() - if waiterr != nil && err == nil { - err = fmt.Errorf("Waiting for %s failed with %v", c.Path, waiterr) - } - }() - - sc := bufio.NewScanner(r) - for sc.Scan() { - entry := sc.Text() - if strings.Contains(entry, mountPath) { - out = append(out, entry, "\n") - } - } - - return out, nil -} - // Remove will unmount and remove the given id. func (a *Driver) Remove(id string) error { a.locker.Lock(id) @@ -331,10 +298,6 @@ func (a *Driver) Remove(id string) error { return fmt.Errorf("aufs: unmount error: %s: %v", mountpoint, err) } if retries >= 5 { - out, debugErr := debugEBusy(mountpoint) - if debugErr == nil { - logrus.Warnf("debugEBusy returned %v", out) - } return fmt.Errorf("aufs: unmount error after retries: %s: %v", mountpoint, err) } // If unmount returns EBUSY, it could be a transient error. Sleep and retry. @@ -353,10 +316,6 @@ func (a *Driver) Remove(id string) error { if err := os.Rename(mountpoint, tmpMntPath); err != nil && !os.IsNotExist(err) { if err == syscall.EBUSY { logrus.Warn("os.Rename err due to EBUSY") - out, debugErr := debugEBusy(mountpoint) - if debugErr == nil { - logrus.Warnf("debugEBusy returned %v", out) - } } return err }