I see that now.  I messed the calls to close() in getNimbusLeaderAddress() and getNimbusHosts(). That seems counter intuitive to me but it works.