Hi Gary,

ACK from me.
Thank you.

Best Regards,
ThuanTr

-----Original Message-----
From: Gary Lee <gary....@dektech.com.au> 
Sent: Tuesday, March 12, 2019 7:32 AM
To: thuan.t...@dektech.com.au; hans.nordeb...@ericsson.com;
minh.c...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net; Gary Lee <gary....@dektech.com.au>
Subject: [PATCH 1/1] osaf: improve response time in etcd3.plugin [#3016]

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
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to