if the initial call to watch takeover request in etcd3.plugin
is made when etcd has already been shutdown (for example,
when etcd is running locally and the node is being shutdown),
the plugin should return 0 with a fake takeover request to ensure
rded shuts down promptly. Otherwise, it will keep calling
watch, delaying node shutdown.
---
 src/osaf/consensus/plugins/etcd3.plugin | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/osaf/consensus/plugins/etcd3.plugin 
b/src/osaf/consensus/plugins/etcd3.plugin
index acccd98..d926885 100644
--- a/src/osaf/consensus/plugins/etcd3.plugin
+++ b/src/osaf/consensus/plugins/etcd3.plugin
@@ -357,9 +357,16 @@ watch() {
         return 0
       fi
     done
+  else
+    # etcd down?
+    if [ "$watch_key" == "$takeover_request" ]; then
+      hostname=`cat $node_name_file`
+      echo "$hostname SC-0 10000000 UNDEFINED"
+      return 0
+    else
+      return 1
+    fi
   fi
-
-  return 1
 }
 
 # argument parsing
-- 
2.7.4



_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to