Github user zd-project commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2789#discussion_r208353770
  
    --- Diff: 
storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java ---
    @@ -2807,7 +2808,14 @@ public void launchServer() throws Exception {
                                             }
                                         });
     
    -            StormMetricsRegistry.registerGauge("nimbus:num-supervisors", 
() -> state.supervisors(null).size());
    +            StormMetricsRegistry.registerGauge("nimbus:num-supervisors", 
() -> {
    +                try {
    +                    return state.supervisors(null).size();
    +                } catch (Exception e) {
    +                    e.printStackTrace();
    --- End diff --
    
    It's a band-aid fix for now to unblock flushing. I should probably redirect 
e.printStackTrace() to LOG.error. To really fix the issue, we either have to 
unregister this gauge manually, which is not ideal, or come up a way to notify 
Nimbus of the shutdown of Zookeeper. This again relates back to the issue that 
I brought up earlier about the connection refused exception from Nimbus to 
Zookeeper, which I don't think have a good fix so far.


---

Reply via email to