@Override public void close() throws IOException { ExceptionAccumulator accumulator = new ExceptionAccumulator(); for ( ServiceProvider<T> provider : Lists.newArrayList(providers) ) { CloseableUtils.closeQuietly(provider); } for ( Entry<T> entry : services.values() ) { try { internalUnregisterService(entry); } catch ( KeeperException.NoNodeException ignore ) { // ignore } catch ( Exception e ) { accumulator.add(e); log.error("Could not unregister instance: " + entry.service.getName(), e); } } client.getConnectionStateListenable().removeListener(connectionStateListener); accumulator.propagate(); }