From fd5e1970e17a382d3120af04ff38cb44d1528ec0 Mon Sep 17 00:00:00 2001 From: Martynas Pumputis Date: Wed, 14 Sep 2016 16:37:38 +0100 Subject: [PATCH 1/3] Return nil netdev if netns of container cannot be found The change applies to GetNetDevsWithPredicate. The function calls FindNetDevs which already does the same filtering. The change prevents from "container-addrs" (weaveutil) returning "unable to open X process namespace" error which happens when a container dies while the cmd is being executed. --- common/utils.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/utils.go b/common/utils.go index 51129500..25130ab2 100644 --- a/common/utils.go +++ b/common/utils.go @@ -132,6 +132,9 @@ func GetNetDevsWithPredicate(processID int, predicate func(link netlink.Link) bo } nsContainr, err := netns.GetFromPid(processID) if err != nil { + if os.IsNotExist(err) { + return nil, nil + } return nil, fmt.Errorf("unable to open process %d namespace: %s", processID, err) } if nsToplevel.Equal(nsContainr) { From 9b32bc2ab385481d8aa8c124ebf978012b87b483 Mon Sep 17 00:00:00 2001 From: Martynas Pumputis Date: Wed, 14 Sep 2016 16:45:40 +0100 Subject: [PATCH 2/3] Close opened netns --- common/utils.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/utils.go b/common/utils.go index 25130ab2..281699a6 100644 --- a/common/utils.go +++ b/common/utils.go @@ -130,6 +130,7 @@ func GetNetDevsWithPredicate(processID int, predicate func(link netlink.Link) bo if err != nil { return nil, fmt.Errorf("unable to open root namespace: %s", err) } + defer nsToplevel.Close() nsContainr, err := netns.GetFromPid(processID) if err != nil { if os.IsNotExist(err) { @@ -137,6 +138,7 @@ func GetNetDevsWithPredicate(processID int, predicate func(link netlink.Link) bo } return nil, fmt.Errorf("unable to open process %d namespace: %s", processID, err) } + defer nsContainr.Close() if nsToplevel.Equal(nsContainr) { return nil, nil } From 370f258c3a36112183ddabaebb85526e92060e51 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 16 Sep 2016 15:53:43 -0700 Subject: [PATCH 3/3] Fix outdated option ipam-seed --- site/operational-guide/uniform-dynamic-cluster.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/operational-guide/uniform-dynamic-cluster.md b/site/operational-guide/uniform-dynamic-cluster.md index 8a73022f..df5f6742 100644 --- a/site/operational-guide/uniform-dynamic-cluster.md +++ b/site/operational-guide/uniform-dynamic-cluster.md @@ -46,14 +46,14 @@ Where On each new peer, at boot, via [systemd](/site/installing-weave/systemd.md): - hostN$ weave launch --no-restart --name ::N --ipam-seed $SEED $PEERS + hostN$ weave launch --no-restart --name ::N --ipalloc-init seed=$SEED $PEERS Where, * `--no-restart` disables the Docker restart policy, since this will be handled by systemd. * `--name` specifies a unique name for this new peer. -* `--ipam-seed` specifies the names of only those peers that were +* `--ipalloc-init seed` specifies the names of only those peers that were involved in the initial cluster bootstrap - even if they have been subsequently removed from the cluster. You can view this as a kind of 'cluster identity',where peers may only interoperate in the same