@Test public void testShutdownWithoutStart_SocketReleased() throws IOException { factory.shutdown(); factory = null; ServerSocket ss = new ServerSocket(listenAddress.getPort()); ss.close(); }
public void shutdown() { try { stop(); join(); closeAll(); if (login != null) { login.shutdown(); } } catch (InterruptedException e) { LOG.warn("Ignoring interrupted exception during shutdown", e); } catch (Exception e) { LOG.warn("Ignoring unexpected exception during shutdown", e); } if (zkServer != null) { zkServer.shutdown(); } }
NIOServerCnxnFactory extends ServerCnxnFactory { public void shutdown() { try { stop(); join(); closeAll(); if (login != null) { login.shutdown(); } } catch (InterruptedException e) { LOG.warn("Ignoring interrupted exception during shutdown", e); } catch (Exception e) { LOG.warn("Ignoring unexpected exception during shutdown", e); } if (zkServer != null) { zkServer.shutdown(); } } }
NIOServerCnxnFactory extends ServerCnxnFactory { public void shutdown() { try { stop(); join(); closeAll(); if (login != null) { login.shutdown(); } } catch (InterruptedException e) { LOG.warn("Ignoring interrupted exception during shutdown", e); } catch (Exception e) { LOG.warn("Ignoring unexpected exception during shutdown", e); } if (zkServer != null) { zkServer.shutdown(); } } NIOServerCnxnFactory(); }
NIOServerCnxnFactory extends ServerCnxnFactory { public void shutdown() { try { stop(); join(); closeAll(); if (login != null) { login.shutdown(); } } catch (InterruptedException e) { LOG.warn("Ignoring interrupted exception during shutdown", e); } catch (Exception e) { LOG.warn("Ignoring unexpected exception during shutdown", e); } if (zkServer != null) { zkServer.shutdown(); } } NIOServerCnxnFactory(); static ByteBuffer getDirectBuffer(); @Override void configure(InetSocketAddress addr, int maxcc, boolean secure); @Override void reconfigure(InetSocketAddress addr); int getMaxClientCnxnsPerHost(); void setMaxClientCnxnsPerHost(int max); @Override void start(); @Override void startup(ZooKeeperServer zks, boolean startServer); @Override InetSocketAddress getLocalAddress(); @Override int getLocalPort(); boolean removeCnxn(NIOServerCnxn cnxn); void touchCnxn(NIOServerCnxn cnxn); @Override @SuppressWarnings("unchecked") void closeAll(); void stop(); void shutdown(); void addSession(long sessionId, NIOServerCnxn cnxn); @Override boolean closeSession(long sessionId); @Override void join(); @Override Iterable<ServerCnxn> getConnections(); void dumpConnections(PrintWriter pwriter); @Override void resetAllConnectionStats(); @Override Iterable<Map<String, Object>> getAllConnectionInfo(boolean brief); }
NIOServerCnxnFactory extends ServerCnxnFactory { public void shutdown() { try { stop(); join(); closeAll(); if (login != null) { login.shutdown(); } } catch (InterruptedException e) { LOG.warn("Ignoring interrupted exception during shutdown", e); } catch (Exception e) { LOG.warn("Ignoring unexpected exception during shutdown", e); } if (zkServer != null) { zkServer.shutdown(); } } NIOServerCnxnFactory(); static ByteBuffer getDirectBuffer(); @Override void configure(InetSocketAddress addr, int maxcc, boolean secure); @Override void reconfigure(InetSocketAddress addr); int getMaxClientCnxnsPerHost(); void setMaxClientCnxnsPerHost(int max); @Override void start(); @Override void startup(ZooKeeperServer zks, boolean startServer); @Override InetSocketAddress getLocalAddress(); @Override int getLocalPort(); boolean removeCnxn(NIOServerCnxn cnxn); void touchCnxn(NIOServerCnxn cnxn); @Override @SuppressWarnings("unchecked") void closeAll(); void stop(); void shutdown(); void addSession(long sessionId, NIOServerCnxn cnxn); @Override boolean closeSession(long sessionId); @Override void join(); @Override Iterable<ServerCnxn> getConnections(); void dumpConnections(PrintWriter pwriter); @Override void resetAllConnectionStats(); @Override Iterable<Map<String, Object>> getAllConnectionInfo(boolean brief); static final String ZOOKEEPER_NIO_SESSIONLESS_CNXN_TIMEOUT; static final String ZOOKEEPER_NIO_NUM_SELECTOR_THREADS; static final String ZOOKEEPER_NIO_NUM_WORKER_THREADS; static final String ZOOKEEPER_NIO_DIRECT_BUFFER_BYTES; static final String ZOOKEEPER_NIO_SHUTDOWN_TIMEOUT; }