You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by su...@apache.org on 2016/11/08 04:22:38 UTC

[2/3] incubator-trafodion git commit: [TRAFODION-2235] Changed interpretation of zclient library errors returned to correctly handle associated znode.

[TRAFODION-2235] Changed interpretation of zclient library errors
                 returned to correctly handle associated znode.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/9d3014f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/9d3014f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/9d3014f8

Branch: refs/heads/master
Commit: 9d3014f83e012830193d15c137f3bf4aa3f4ccf1
Parents: e54699f
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Nov 7 12:43:17 2016 -0800
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Nov 7 12:43:17 2016 -0800

----------------------------------------------------------------------
 core/sqf/monitor/linux/zclient.cxx | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9d3014f8/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/zclient.cxx b/core/sqf/monitor/linux/zclient.cxx
index c57884c..584ac07 100644
--- a/core/sqf/monitor/linux/zclient.cxx
+++ b/core/sqf/monitor/linux/zclient.cxx
@@ -728,12 +728,15 @@ bool CZClient::IsZNodeExpired( const char *nodeName )
                     , method_name, __LINE__, monZnode.c_str() );
     }
     rc = zoo_exists( ZHandle, monZnode.c_str( ), 0, &stat );
-    if ( rc == ZNONODE )
+    if ( rc == ZNONODE ||
+         rc == ZCONNECTIONLOSS || 
+         rc == ZOPERATIONTIMEOUT )
     {
         expired = true;
         if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
         {
-            trace_printf( "%s@%d monZnode=%s does not exist (ZNONODE)\n"
+            trace_printf( "%s@%d monZnode=%s does not exist or "
+                          "cannot be accessed!\n"
                         , method_name, __LINE__, monZnode.c_str() );
         }
     }
@@ -758,10 +761,8 @@ bool CZClient::IsZNodeExpired( const char *nodeName )
         case ZSYSTEMERROR:
         case ZRUNTIMEINCONSISTENCY:
         case ZDATAINCONSISTENCY:
-        case ZCONNECTIONLOSS:
         case ZMARSHALLINGERROR:
         case ZUNIMPLEMENTED:
-        case ZOPERATIONTIMEOUT:
         case ZBADARGUMENTS:
         case ZINVALIDSTATE:
         case ZSESSIONEXPIRED:
@@ -1143,12 +1144,15 @@ int CZClient::SetZNodeWatch( string &monZnode )
                     , method_name, __LINE__, monZnode.c_str() );
     }
     rc = zoo_exists( ZHandle, monZnode.c_str( ), 0, &stat );
-    if ( rc == ZNONODE )
+    if ( rc == ZNONODE ||
+         rc == ZCONNECTIONLOSS || 
+         rc == ZOPERATIONTIMEOUT )
     {
         // return the error
         if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
         {
-            trace_printf( "%s@%d monZnode=%s does not exist (ZNONODE)\n"
+            trace_printf( "%s@%d monZnode=%s does not exist or "
+                          "cannot be accessed!\n"
                         , method_name, __LINE__, monZnode.c_str() );
         }
     }
@@ -1177,10 +1181,8 @@ int CZClient::SetZNodeWatch( string &monZnode )
         case ZSYSTEMERROR:
         case ZRUNTIMEINCONSISTENCY:
         case ZDATAINCONSISTENCY:
-        case ZCONNECTIONLOSS:
         case ZMARSHALLINGERROR:
         case ZUNIMPLEMENTED:
-        case ZOPERATIONTIMEOUT:
         case ZBADARGUMENTS:
         case ZINVALIDSTATE:
         case ZSESSIONEXPIRED:
@@ -1519,12 +1521,14 @@ int CZClient::WatchNodeDelete( const char *nodeName )
                 , method_name, nodeName );
         mon_log_write(MON_ZCLIENT_WATCHNODEDELETE_1, SQ_LOG_INFO, buf);
     }
-    else if ( rc == ZNONODE )
+    else if ( rc == ZNONODE ||
+              rc == ZCONNECTIONLOSS || 
+              rc == ZOPERATIONTIMEOUT )
     {
         rc = ZOK;
         char buf[MON_STRING_BUF_SIZE];
         snprintf( buf, sizeof(buf)
-                , "[%s], znode (%s) already deleted!\n"
+                , "[%s], znode (%s) already deleted or cannot be accessed!\n"
                 , method_name, nodeName );
         mon_log_write(MON_ZCLIENT_WATCHNODEDELETE_2, SQ_LOG_INFO, buf);
     }
@@ -1540,10 +1544,8 @@ int CZClient::WatchNodeDelete( const char *nodeName )
         case ZSYSTEMERROR:
         case ZRUNTIMEINCONSISTENCY:
         case ZDATAINCONSISTENCY:
-        case ZCONNECTIONLOSS:
         case ZMARSHALLINGERROR:
         case ZUNIMPLEMENTED:
-        case ZOPERATIONTIMEOUT:
         case ZBADARGUMENTS:
         case ZINVALIDSTATE:
         case ZSESSIONEXPIRED: