[ 
https://issues.apache.org/jira/browse/CURATOR-585?focusedWorklogId=523390&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-523390
 ]

ASF GitHub Bot logged work on CURATOR-585:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Dec/20 11:03
            Start Date: 12/Dec/20 11:03
    Worklog Time Spent: 10m 
      Work Description: eolivelli commented on a change in pull request #375:
URL: https://github.com/apache/curator/pull/375#discussion_r541554666



##########
File path: curator-examples/src/main/java/discovery/DiscoveryExample.java
##########
@@ -192,6 +194,14 @@ private static void 
listInstances(ServiceDiscovery<InstanceDetails> serviceDisco
                 }
             }
         }
+        catch ( Exception e )
+        {
+            if ( e instanceof KeeperException.NoNodeException )

Review comment:
       which instruction can throw this exception ? is it possible that it is 
throws inside the inner loop ? 
   in that case we could end the loop prematurely .
   that do you think ?




----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 523390)
    Time Spent: 40m  (was: 0.5h)

> Discovery sample did not check for exceptions
> ---------------------------------------------
>
>                 Key: CURATOR-585
>                 URL: https://issues.apache.org/jira/browse/CURATOR-585
>             Project: Apache Curator
>          Issue Type: Bug
>    Affects Versions: 5.1.0
>         Environment: MacBook Pro (15-inch, 2019)
>            Reporter: 王杰
>            Assignee: Jordan Zimmerman
>            Priority: Minor
>             Fix For: awaiting-response
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> I tried to run `DiscoveryExample` to simulate service discovery, when I first 
> entered list to see the list of registrations, I found that the process 
> exited directly, I checked the code and found that the code threw 
> `NoNodeException` but it was ignored.
> I think if there is no service registered, using `list` should tell me that 
> no service is registered instead of just ignoring the exception and closing 
> the connection, so I am asking this question, what do you think?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to