mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Better error handling in restoring sandbox states
Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
parent
f142339334
commit
849712f35d
2 changed files with 10 additions and 0 deletions
|
@ -726,6 +726,12 @@ func (sb *sandbox) restoreOslSandbox() error {
|
||||||
joinInfo := ep.joinInfo
|
joinInfo := ep.joinInfo
|
||||||
i := ep.iface
|
i := ep.iface
|
||||||
ep.Unlock()
|
ep.Unlock()
|
||||||
|
|
||||||
|
if i == nil {
|
||||||
|
log.Errorf("error restoring endpoint %s for container %s", ep.Name(), sb.ContainerID())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
ifaceOptions = append(ifaceOptions, sb.osSbox.InterfaceOptions().Address(i.addr), sb.osSbox.InterfaceOptions().Routes(i.routes))
|
ifaceOptions = append(ifaceOptions, sb.osSbox.InterfaceOptions().Address(i.addr), sb.osSbox.InterfaceOptions().Routes(i.routes))
|
||||||
if i.addrv6 != nil && i.addrv6.IP.To16() != nil {
|
if i.addrv6 != nil && i.addrv6.IP.To16() != nil {
|
||||||
ifaceOptions = append(ifaceOptions, sb.osSbox.InterfaceOptions().AddressIPv6(i.addrv6))
|
ifaceOptions = append(ifaceOptions, sb.osSbox.InterfaceOptions().AddressIPv6(i.addrv6))
|
||||||
|
|
|
@ -245,6 +245,10 @@ func (c *controller) sandboxCleanup(activeSandboxes map[string]interface{}) {
|
||||||
ep = &endpoint{id: eps.Eid, network: n, sandboxID: sbs.ID}
|
ep = &endpoint{id: eps.Eid, network: n, sandboxID: sbs.ID}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if _, ok := activeSandboxes[sb.ID()]; ok && err != nil {
|
||||||
|
logrus.Errorf("failed to restore endpoint %s in %s for container %s due to %v", eps.Eid, eps.Nid, sb.ContainerID(), err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
heap.Push(&sb.endpoints, ep)
|
heap.Push(&sb.endpoints, ep)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue