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

Merge pull request #1334 from polachok/retry

Actually retry LinkSetUp
This commit is contained in:
Alessandro Boch 2016-07-19 08:24:53 -07:00 committed by GitHub
commit d8ef832bc1

View file

@ -303,6 +303,7 @@ func (n *networkNamespace) AddInterface(srcName, dstPrefix string, options ...If
for err = nlh.LinkSetUp(iface); err != nil && cnt < 3; cnt++ { for err = nlh.LinkSetUp(iface); err != nil && cnt < 3; cnt++ {
log.Debugf("retrying link setup because of: %v", err) log.Debugf("retrying link setup because of: %v", err)
time.Sleep(10 * time.Millisecond) time.Sleep(10 * time.Millisecond)
err = nlh.LinkSetUp(iface)
} }
if err != nil { if err != nil {
return fmt.Errorf("failed to set link up: %v", err) return fmt.Errorf("failed to set link up: %v", err)