-
Notifications
You must be signed in to change notification settings - Fork 678
Weave (2.4.1) pods memory leak with "seeded by different peers" error #3427
Comments
Hi, thanks for the report, could you post the full logs of the |
Since it's at 102% CPU, perhaps it is in a tight loop. |
here is full log: https://gist.github.com/Dmitry1987/27c46a0ce9fd5bce097098044721de12 I noticed that for example one leaking machine is always mentioned in these messages:
so this might be a hint of the issue |
I suspect it is because of one of the nodes which was redeployed to another cluster by mistake and has these "connection shutting down due to error: IP allocation was seeded by different peers"... but I still can't find which one it is, because appears that all weave pods in cluster-1 scream about "cluster-2" nodes that they are "seeded blahblahblah" but how they got information about each other I don't get it :D The redeploy job we have, uses kubeadm reset + deleting the weave db in "/var/lib/weave/weave-netdata.db" |
I'm not clear how it gets to those lines in the profile or what it is trying to do. So it would still be good to get the log after SIGQUIT, or equivalently the goroutines profile. |
@bboreham ok we figured this out, the leak was in function related to the error of "IPs seeded by different peers" after some of our machines were redeployed to another cluster and probably their weave db was not deleted by the automation scripts. |
From the set of symptoms, it could be similar to #1830 - gossip data building up. The "seeded by different peers" condition is absolutely fatal to Weave Net, so maybe we should think about ways to make that clearer. It doesn't really help to fix the memory blow-up when it then won't communicate between nodes. |
@bboreham that makes sense, but in our case the memory leak was worse for our application than losing weave and overlay networking functionality (we have a service, on these clusters, that doesn't even communicate with any other pods, so it doesn't care about overlay, it's kinda standalone. we used K8s for it just for the easy Helm templating and to be in same "format" with all other projects and services that we have :) it's kinda a set of several separate clusters which hold an important service as HA on many machines). So, the moment weave died, we didn't even noticed (I guess we could've noticed if we had microservices in this cluster that communicate with each other, but our app is standalone and the world talks to it directly on all nodes), but when memory leaked and affected performance of the "standalone" app on these nodes, just then we found out something is broken :) I mean, the memory leak needs to be somehow limited or fixed anyway, IMHO. To avoid even more damage on top of the loss of overlay connectivity (I'm not even sure... the 'fatal' condition you mean was the pods cannot talk to each other or something? I didn't even tested this, you see, because the app does not require pods communication... I know it might sound like overkill to use K8s for an app like that, but it's just so easy and nice to utilize K8s daemonsets, kubeadm init joins for new nodes, configmaps and their tracking in git, easy metrics and logging collection.. so we had to go with K8s for that). One more question though, can the weave corruption happed even after the /var/lib/weave/ folder was cleaned (for sure) and we did "kubeadm reset", and then did "kubeadm join" to another cluster? (maybe it took the "bad IPs" of previous cluster, from iptables that were not flushed?) Because iptables was the only thing which could have traces of something about old "peers" of this machine. I can't find how it was caused, the "bad peers" condition, the logs of "re-attach worker node to another K8s cluster" job (that we use to move nodes between one cluster to another if we really need to) show clearly that /var/lib/weave/ was deleted for sure, before a new "kubeadm join" was run. |
When you remove a peer from a cluster, all the peers that were told to connect to it at startup will continue to attempt a re-connection. So if you want to add it to a new cluster, it is possible the old cluster will re-connect to it first. After #3399, if you delete a node in the Kubernetes api-server then all the remaining nodes in that cluster will remove that node from their list and stop trying to re-connect. |
ok thanks, it makes sense to clean up deleted nodes automatically. It also solves the memory leak right? I guess we can close this issue then 👍 |
What you expected to happen?
Weave pod from default DaemonSet to not eat up 14-16GB of RAM 👍
What happened?
Memory leak of all weave pods in cluster:

We thought at first it's our app, but were surprised to see this was weave pod on all servers.
How to reproduce it?
Anything else we need to know?
K8s master on DigitalOcean, 6cpu / 16gb RAM.
Versions:
ubuntu:
kubectl / kubelet / kubeadm are 1.11.3
weave daemonset:
Logs:
The most problematic piece of log was when someone reattached a machine from one cluster to another without cleaning properly I think, not sure about the reason, but expect weave to handle this without memory/cpu leaks (by the way the CPU usage was 50% on a leaked pod I just checked with 'docker stats' so both the memory and the CPU suffer from this.
I don't know if this can be the issue, but of course it's expected that weave will not misbehave in terms of resource usage if this happens.
The text was updated successfully, but these errors were encountered: