You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/10/02 02:40:40 UTC
[GitHub] [zookeeper] mahitab-farid opened a new pull request #1475: Zookeeper muse bugbash2020 check null child names
mahitab-farid opened a new pull request #1475:
URL: https://github.com/apache/zookeeper/pull/1475
Fix bugs according to Muse report in zookeeper-recipes/.../DistributedQueue.java:
* object childNames last assigned on line 69 could be null and is dereferenced at line 71.
* object childNames last assigned on line 100 could be null and is dereferenced at line 106.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] mahitab-farid commented on pull request #1475: Zookeeper muse bugbash2020 check null child names
Posted by GitBox <gi...@apache.org>.
mahitab-farid commented on pull request #1475:
URL: https://github.com/apache/zookeeper/pull/1475#issuecomment-703245761
Thank you @eolivelli
Is there Issue number for Muse reported issues reported here: https://console.muse.dev/result/ayorra/zookeeper/01EETWTMZYSND1TMEQMGTKH0EA?tab=results
?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] mahitab-farid commented on a change in pull request #1475: Zookeeper muse bugbash2020 check null child names
Posted by GitBox <gi...@apache.org>.
mahitab-farid commented on a change in pull request #1475:
URL: https://github.com/apache/zookeeper/pull/1475#discussion_r499238526
##########
File path: zookeeper-recipes/zookeeper-recipes-queue/src/main/java/org/apache/zookeeper/recipes/queue/DistributedQueue.java
##########
@@ -94,13 +98,17 @@ private String smallestChildName() throws KeeperException, InterruptedException
long minId = Long.MAX_VALUE;
String minName = "";
- List<String> childNames;
+ List<String> childNames = null;
try {
childNames = zookeeper.getChildren(dir, false);
} catch (KeeperException.NoNodeException e) {
LOG.warn("Unexpected exception", e);
return null;
+ } finally {
+ if (childNames == null) {
+ return null;
Review comment:
Ok, I will make it outside try block.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] eolivelli commented on a change in pull request #1475: Zookeeper muse bugbash2020 check null child names
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #1475:
URL: https://github.com/apache/zookeeper/pull/1475#discussion_r498914836
##########
File path: zookeeper-recipes/zookeeper-recipes-queue/src/main/java/org/apache/zookeeper/recipes/queue/DistributedQueue.java
##########
@@ -94,13 +98,17 @@ private String smallestChildName() throws KeeperException, InterruptedException
long minId = Long.MAX_VALUE;
String minName = "";
- List<String> childNames;
+ List<String> childNames = null;
try {
childNames = zookeeper.getChildren(dir, false);
} catch (KeeperException.NoNodeException e) {
LOG.warn("Unexpected exception", e);
return null;
+ } finally {
+ if (childNames == null) {
+ return null;
Review comment:
returning in a finally block is a code smell.
can we return "null" when we are out of the try block ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [zookeeper] TomMD commented on pull request #1475: Zookeeper muse bugbash2020 check null child names
Posted by GitBox <gi...@apache.org>.
TomMD commented on pull request #1475:
URL: https://github.com/apache/zookeeper/pull/1475#issuecomment-703818802
@mahitab-farid No, there aren't any JIRA issues for the Muse bug list. The contribution guide I linked previously steps through it though. Apache uses JIRA heavily so it helps them quite a bit to keep organized.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org