You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ma...@apache.org on 2017/11/17 13:06:47 UTC

[incubator-openwhisk] branch master updated: Fix bug when remove invoker. (#2978)

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

markusthoemmes 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 440c850  Fix bug when remove invoker. (#2978)
440c850 is described below

commit 440c85070b4ead5f8050ac211bf02d945c85fdbc
Author: ningyougang <41...@qq.com>
AuthorDate: Fri Nov 17 21:06:45 2017 +0800

    Fix bug when remove invoker. (#2978)
    
    If deploy mutilple invoker instances on one physical node, and execute
    ansible task of remove remaining actions, exist below problems:
    - Cost much time, becuase when remove invoker0, the task will remove
      action container wsk0_ container, wsk1_ container, and so on,
      on the other hand, wsk1_container is removed by invoker1's stop hook
      default, so that's the reason why the task will cost much time.
    - It may remove other invoker's action container, this is wrong logic,
      righ logic is that inovker0 remove wsk0_ container, invoker1 remove wsk1_
      container, and so on
    
    So it is necessary to add exact filter to wsk action container when remove
    invoker.
---
 ansible/roles/invoker/tasks/clean.yml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ansible/roles/invoker/tasks/clean.yml b/ansible/roles/invoker/tasks/clean.yml
index c5c9592..16e99a7 100644
--- a/ansible/roles/invoker/tasks/clean.yml
+++ b/ansible/roles/invoker/tasks/clean.yml
@@ -13,9 +13,9 @@
 # In case the invoker could not clean up completely in time.
 - name: pause/resume at runc-level to restore docker consistency
   shell: |
-        DOCKER_PAUSED=$(docker ps --filter status=paused --filter name=wsk -q --no-trunc)
+        DOCKER_PAUSED=$(docker ps --filter status=paused --filter name=wsk{{ groups['invokers'].index(inventory_hostname) }} -q --no-trunc)
         for C in $DOCKER_PAUSED; do docker-runc pause $C; done
-        DOCKER_RUNNING=$(docker ps --filter status=running --filter name=wsk -q --no-trunc)
+        DOCKER_RUNNING=$(docker ps --filter status=running --filter name=wsk{{ groups['invokers'].index(inventory_hostname) }} -q --no-trunc)
         for C2 in $DOCKER_RUNNING; do docker-runc resume $C2; done
         TOTAL=$(($(echo $DOCKER_PAUSED | wc -w)+$(echo $DOCKER_RUNNING | wc -w)))
         echo "Handled $TOTAL remaining actions."
@@ -26,11 +26,11 @@
 - debug: msg="{{ runc_output.stdout }}"
 
 - name: unpause remaining actions
-  shell: "docker unpause $(docker ps -aq --filter status=paused --filter name=wsk)"
+  shell: "docker unpause $(docker ps -aq --filter status=paused --filter name=wsk{{ groups['invokers'].index(inventory_hostname) }})"
   failed_when: False
 
 - name: remove remaining actions
-  shell: "docker rm -f $(docker ps -aq --filter name=wsk)"
+  shell: "docker rm -f $(docker ps -aq --filter name=wsk{{ groups['invokers'].index(inventory_hostname) }})"
   failed_when: False
 
 - name: remove invoker log directory

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