You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2019/07/24 23:50:44 UTC
[helix] branch master updated: Read Failure while reading
non-existent znode
This is an automated email from the ASF dual-hosted git repository.
jxue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git
The following commit(s) were added to refs/heads/master by this push:
new c930096 Read Failure while reading non-existent znode
c930096 is described below
commit c9300968690024765fe9d66ca1ac248720cd0af8
Author: Ali Najari <an...@linkedin.com>
AuthorDate: Wed Jul 17 14:21:40 2019 -0700
Read Failure while reading non-existent znode
In this commit, in case of encountering NoNodeException while reading data from a znode that does not exist, the NoNodeException will be caught and readfailurecounter will not incremented.
Instead, the related information (read Counter, read Latency, etc.) will be recorded.
This commit fixes issue #345.
---
.../java/org/apache/helix/manager/zk/zookeeper/ZkClient.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/helix-core/src/main/java/org/apache/helix/manager/zk/zookeeper/ZkClient.java b/helix-core/src/main/java/org/apache/helix/manager/zk/zookeeper/ZkClient.java
index 5dd000d..66f26d6 100644
--- a/helix-core/src/main/java/org/apache/helix/manager/zk/zookeeper/ZkClient.java
+++ b/helix-core/src/main/java/org/apache/helix/manager/zk/zookeeper/ZkClient.java
@@ -721,6 +721,9 @@ public class ZkClient implements Watcher {
});
record(path, null, startT, ZkClientMonitor.AccessType.READ);
return children;
+ } catch (ZkNoNodeException e) {
+ record(path, null, startT, ZkClientMonitor.AccessType.READ);
+ throw e;
} catch (Exception e) {
recordFailure(path, ZkClientMonitor.AccessType.READ);
throw e;
@@ -760,6 +763,9 @@ public class ZkClient implements Watcher {
});
record(path, null, startT, ZkClientMonitor.AccessType.READ);
return exists;
+ } catch (ZkNoNodeException e) {
+ record(path, null, startT, ZkClientMonitor.AccessType.READ);
+ throw e;
} catch (Exception e) {
recordFailure(path, ZkClientMonitor.AccessType.READ);
throw e;
@@ -782,6 +788,9 @@ public class ZkClient implements Watcher {
() -> ((ZkConnection) getConnection()).getZookeeper().exists(path, watch));
record(path, null, startT, ZkClientMonitor.AccessType.READ);
return stat;
+ } catch (ZkNoNodeException e) {
+ record(path, null, startT, ZkClientMonitor.AccessType.READ);
+ throw e;
} catch (Exception e) {
recordFailure(path, ZkClientMonitor.AccessType.READ);
throw e;
@@ -1293,6 +1302,9 @@ public class ZkClient implements Watcher {
});
record(path, data, startT, ZkClientMonitor.AccessType.READ);
return (T) deserialize(data, path);
+ } catch (ZkNoNodeException e) {
+ record(path, data, startT, ZkClientMonitor.AccessType.READ);
+ throw e;
} catch (Exception e) {
recordFailure(path, ZkClientMonitor.AccessType.READ);
throw e;