> On Dec. 5, 2019, 4:43 p.m., Panos Garefalakis wrote: > > llap-client/src/java/org/apache/hadoop/hive/registry/impl/ZkRegistryBase.java > > Lines 478 (patched) > > <https://reviews.apache.org/r/71871/diff/1/?file=2181935#file2181935line478> > > > > Hey Attila, > > > > With Java's short circuiting the the left expression in the && > > operarator will always be evaluated which could also throw the error you > > are trying to avoid -- to safeguard this operation you would place the > > **nodeName.length() > workerNodePrefix.length()** check on the left part of > > the expression. > > Attila Magyar wrote: > Hey Panos, > > That's true, but the error is not originated from the startsWith() but > from a subString() expression later on. The startsWith() method doesn't throw > any expressions it won't fail regardless the length of nodeName or > workerNodePrefix. > > Attila Magyar wrote: > However there is an off by one error in the substring, this comment made > me realize it, fixing it in the 2nd patch..
+1 for the substring - Panos ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/71871/#review218941 ----------------------------------------------------------- On Dec. 5, 2019, 6:03 p.m., Attila Magyar wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/71871/ > ----------------------------------------------------------- > > (Updated Dec. 5, 2019, 6:03 p.m.) > > > Review request for hive, Laszlo Bodor, prasanthj, and Slim Bouguerra. > > > Bugs: HIVE-22577 > https://issues.apache.org/jira/browse/HIVE-22577 > > > Repository: hive-git > > > Description > ------- > > The sequence number from the worker node name might be missing under some > circumstances (the root cause is not fully clear it might be a zookeeper bug). > > In this case the following exception occurs: > > Caused by: java.lang.StringIndexOutOfBoundsException: String index out of > range: -1Caused by: java.lang.StringIndexOutOfBoundsException: String index > out of range: -1 at java.lang.String.substring(String.java:1931) at > org.apache.hadoop.hive.registry.impl.ZkRegistryBase.extractSeqNum(ZkRegistryBase.java:781) > at > org.apache.hadoop.hive.registry.impl.ZkRegistryBase.populateCache(ZkRegistryBase.java:507) > at > org.apache.hadoop.hive.llap.registry.impl.LlapZookeeperRegistryImpl.access$000(LlapZookeeperRegistryImpl.java:65) > at > > > Diffs > ----- > > > llap-client/src/java/org/apache/hadoop/hive/registry/impl/ZkRegistryBase.java > 5751b8ed939 > > > Diff: https://reviews.apache.org/r/71871/diff/2/ > > > Testing > ------- > > qtest > > > Thanks, > > Attila Magyar > >