You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2017/12/07 13:04:34 UTC

[incubator-openwhisk] branch master updated: Clean orphaned ifstate.veth* files on Ubuntu 14.04 (#3007)

This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 497567b  Clean orphaned ifstate.veth* files on Ubuntu 14.04 (#3007)
497567b is described below

commit 497567b7ce56137bb8a6bfda36e45b7936f558c6
Author: Sven Lange-Last <sv...@de.ibm.com>
AuthorDate: Thu Dec 7 14:04:32 2017 +0100

    Clean orphaned ifstate.veth* files on Ubuntu 14.04 (#3007)
    
    Ubuntu 14.04 has a well-known bug that leaves orphaned `ifstate.veth*` files in `/run/network` when creating / removing a virtual ethernet interface pair with `ip link add name veth1 type veth peer name veth2` and `ip link delete veth1`. Docker containers use these `veth` pairs: when a Docker container is created, Docker creates a pair and removes it when the container is removed. If a lot of containers are created, the file system where `/run/network` resides, runs out of inodes so t [...]
    
    Invokers running on Ubuntu 14.04 VMs can be affected by the described situation if a lot of cold invocations are run.
    
    Remove orphaned `ifstate.veth*` files older than 60 minutes in `/run/network` on Ubuntu 14.04 when cleaning an invoker host. The cleaning commands always have to be run as `root` because other users are not allowed to remove the files.
---
 ansible/roles/invoker/tasks/clean.yml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/ansible/roles/invoker/tasks/clean.yml b/ansible/roles/invoker/tasks/clean.yml
index 16e99a7..9d519f5 100644
--- a/ansible/roles/invoker/tasks/clean.yml
+++ b/ansible/roles/invoker/tasks/clean.yml
@@ -38,3 +38,14 @@
     path: "{{ whisk_logs_dir }}/invoker{{ groups['invokers'].index(inventory_hostname) }}"
     state: absent
   become: "{{ logs.dir.become }}"
+
+# Workaround for orphaned ifstate.veth* files on Ubuntu 14.04
+# See https://github.com/moby/moby/issues/22513
+# Remove inactive files older than 60 minutes
+- name: "Clean orphaned ifstate.veth* files on Ubuntu 14.04"
+  shell: |
+    ACTIVE_IFACES_REGEXP=$(ip -oneline link show | grep --only-matching --extended-regexp 'veth[0-9a-f]+' | tr '\n' '|' | sed -e 's/.$//' | xargs -I '{}' /bin/echo '/run/network/ifstate\.({})')
+    find /run/network -regextype posix-egrep \( -not -regex ${ACTIVE_IFACES_REGEXP} \) -and -name 'ifstate.veth*' -and -mmin +60 -delete
+  ignore_errors: True
+  become: True
+  when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '14.04'

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].