mirror of https://github.com/docker/docs.git
Merge pull request #17639 from mrjana/restart
Fix a corner case issue when daemon panics
This commit is contained in:
commit
b2f14f9bec
|
@ -21,7 +21,7 @@ clone git github.com/vdemeester/shakers 3c10293ce22b900c27acad7b28656196fcc2f73b
|
||||||
clone git golang.org/x/net 3cffabab72adf04f8e3b01c5baf775361837b5fe https://github.com/golang/net.git
|
clone git golang.org/x/net 3cffabab72adf04f8e3b01c5baf775361837b5fe https://github.com/golang/net.git
|
||||||
|
|
||||||
#get libnetwork packages
|
#get libnetwork packages
|
||||||
clone git github.com/docker/libnetwork e7719596c01a83f9ef24d33e9d609a64acacd7b8
|
clone git github.com/docker/libnetwork 5305ea570b85d61dd0fd261cd7e1680da1884678
|
||||||
clone git github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec
|
clone git github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec
|
||||||
clone git github.com/hashicorp/go-msgpack 71c2886f5a673a35f909803f38ece5810165097b
|
clone git github.com/hashicorp/go-msgpack 71c2886f5a673a35f909803f38ece5810165097b
|
||||||
clone git github.com/hashicorp/memberlist 9a1e242e454d2443df330bdd51a436d5a9058fc4
|
clone git github.com/hashicorp/memberlist 9a1e242e454d2443df330bdd51a436d5a9058fc4
|
||||||
|
|
|
@ -177,13 +177,18 @@ func (sb *sandbox) Delete() error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := ep.Leave(sb); err != nil {
|
// Retain the sanbdox if we can't obtain the network from store.
|
||||||
|
if _, err := c.getNetworkFromStore(ep.getNetwork().ID()); err != nil {
|
||||||
retain = true
|
retain = true
|
||||||
|
log.Warnf("Failed getting network for ep %s during sandbox %s delete: %v", ep.ID(), sb.ID(), err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := ep.Leave(sb); err != nil {
|
||||||
log.Warnf("Failed detaching sandbox %s from endpoint %s: %v\n", sb.ID(), ep.ID(), err)
|
log.Warnf("Failed detaching sandbox %s from endpoint %s: %v\n", sb.ID(), ep.ID(), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := ep.Delete(); err != nil {
|
if err := ep.Delete(); err != nil {
|
||||||
retain = true
|
|
||||||
log.Warnf("Failed deleting endpoint %s: %v\n", ep.ID(), err)
|
log.Warnf("Failed deleting endpoint %s: %v\n", ep.ID(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -455,7 +460,7 @@ func (sb *sandbox) populateNetworkResources(ep *endpoint) error {
|
||||||
i := ep.iface
|
i := ep.iface
|
||||||
ep.Unlock()
|
ep.Unlock()
|
||||||
|
|
||||||
if i.srcName != "" {
|
if i != nil && i.srcName != "" {
|
||||||
var ifaceOptions []osl.IfaceOption
|
var ifaceOptions []osl.IfaceOption
|
||||||
|
|
||||||
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))
|
||||||
|
@ -951,6 +956,11 @@ func OptionGeneric(generic map[string]interface{}) SandboxOption {
|
||||||
func (eh epHeap) Len() int { return len(eh) }
|
func (eh epHeap) Len() int { return len(eh) }
|
||||||
|
|
||||||
func (eh epHeap) Less(i, j int) bool {
|
func (eh epHeap) Less(i, j int) bool {
|
||||||
|
var (
|
||||||
|
cip, cjp int
|
||||||
|
ok bool
|
||||||
|
)
|
||||||
|
|
||||||
ci, _ := eh[i].getSandbox()
|
ci, _ := eh[i].getSandbox()
|
||||||
cj, _ := eh[j].getSandbox()
|
cj, _ := eh[j].getSandbox()
|
||||||
|
|
||||||
|
@ -965,14 +975,20 @@ func (eh epHeap) Less(i, j int) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
cip, ok := ci.epPriority[eh[i].ID()]
|
if ci != nil {
|
||||||
if !ok {
|
cip, ok = ci.epPriority[eh[i].ID()]
|
||||||
cip = 0
|
if !ok {
|
||||||
|
cip = 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cjp, ok := cj.epPriority[eh[j].ID()]
|
|
||||||
if !ok {
|
if cj != nil {
|
||||||
cjp = 0
|
cjp, ok = cj.epPriority[eh[j].ID()]
|
||||||
|
if !ok {
|
||||||
|
cjp = 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if cip == cjp {
|
if cip == cjp {
|
||||||
return eh[i].network.Name() < eh[j].network.Name()
|
return eh[i].network.Name() < eh[j].network.Name()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue