private ExecutorService initializeHandshakerThreadPool() throws IOException { String threadName = "Handshaker " + serverSock.getInetAddress() + ":" + this.localPort + " Thread "; try { logger.warn("Handshaker max Pool size: " + HANDSHAKE_POOL_SIZE); return LoggingExecutors.newThreadPoolWithSynchronousFeedThatHandlesRejection(threadName, thread -> getStats().incAcceptThreadsCreated(), null, 1, HANDSHAKE_POOL_SIZE, 60); } catch (IllegalArgumentException poolInitException) { this.stats.close(); this.serverSock.close(); this.pool.shutdown(); throw poolInitException; } }
final ServerConnectionFactory serverConnectionFactory) { try { this.stats.incAcceptsInProgress(); this.hsPool.execute(new Runnable() { @Override closeSocket(socket); if (isRunning()) { this.stats.decAcceptsInProgress(); logger.warn("unexpected", rejected);
@Override public void endJob() { decConnectionThreads(); } };
private ExecutorService initializeServerConnectionThreadPool() throws IOException { String threadName = "ServerConnection on port " + this.localPort + " Thread "; ThreadInitializer threadInitializer = thread -> getStats().incConnectionThreadsCreated(); CommandWrapper commandWrapper = command -> { try { command.run(); } catch (CancelException e) { // bug 39463 // ignore } finally { ConnectionTable.releaseThreadsSockets(); } }; try { if (isSelector()) { return LoggingExecutors.newThreadPoolWithUnlimitedFeed(threadName, threadInitializer, commandWrapper, this.maxThreads, getStats().getCnxPoolHelper(), Integer.MAX_VALUE, getThreadMonitorObj()); } else { return LoggingExecutors.newThreadPoolWithSynchronousFeed(threadName, threadInitializer, commandWrapper, MINIMUM_MAX_CONNECTIONS, this.maxConnections, 0L); } } catch (IllegalArgumentException poolInitException) { this.stats.close(); this.serverSock.close(); throw poolInitException; } }
clientDeparted = true; getCleanupTable().remove(this.handshake); this.stats.decCurrentClients(); this.stats.decCurrentQueueConnections(); } else { this.stats.decCurrentClientConnections();
AcceptorImpl.this.stats.incThreadQueueSize(); AcceptorImpl.this.pool.execute(sc); } catch (RejectedExecutionException rejected) { finishCon(sc); AcceptorImpl.this.stats.decThreadQueueSize(); if (!isRunning()) { break;
/** * The work loop of this acceptor * * @see #accept */ @Override public void run() { try { accept(); } catch (CancelException e) { // bug 39462 // ignore } finally { try { if (this.serverSock != null) { this.serverSock.close(); } } catch (IOException ignore) { } if (this.stats != null) { this.stats.close(); } } }
public void addCacheServerStats(CacheServerStats cacheServerStats) { monitor.addStatisticsToMonitor(cacheServerStats.getStats()); }
private ExecutorService initializeClientQueueInitializerThreadPool() throws IOException { return LoggingExecutors.newThreadPoolWithSynchronousFeed("Client Queue Initialization Thread ", command -> { try { command.run(); } catch (CancelException e) { logger.debug("Client Queue Initialization was canceled.", e); } }, CLIENT_QUEUE_INITIALIZATION_POOL_SIZE, getStats().getCnxPoolHelper(), 60000, getThreadMonitorObj()); }
private boolean closeSocket() { String remoteHostAddress = this._remoteHostAddress; if (this._socketClosed.compareAndSet(false, true) && remoteHostAddress != null) { // Only one thread is expected to close the socket this._cacheClientNotifier.getSocketCloser().asyncClose(this._socket, remoteHostAddress, null); getCacheClientNotifier().getAcceptorStats().decCurrentQueueConnections(); return true; } return false; }
AcceptorImpl.this.stats.decAcceptsInProgress();
this.stats = GatewayReceiverStats.createGatewayReceiverStats(sockName); } else { this.stats = new CacheServerStats(sockName);
boolean finishedMessage = false; try { this.stats.decThreadQueueSize(); if (!isTerminated()) { getAcceptor().setTLCommBuffer();
AcceptorImpl.this.stats.incThreadQueueSize(); AcceptorImpl.this.pool.execute(sc); } catch (RejectedExecutionException rejected) { finishCon(sc); AcceptorImpl.this.stats.decThreadQueueSize(); if (!isRunning()) { break;
this.clientNotifier.shutdown(this.acceptorId); shutdownPools(); this.stats.close(); if (!cache.isClosed()) {