NIFI-1068 Fix EndpointConnectionPool to properly remove connections from activeConnections when terminating connections

Signed-off-by: Mark Payne <markap14@hotmail.com>
This commit is contained in:
Joseph Percivall 2015-10-26 17:35:23 -04:00 committed by Mark Payne
parent ad849c77df
commit 37e2f178f8
1 changed files with 2 additions and 1 deletions

View File

@ -820,12 +820,13 @@ public class EndpointConnectionPool {
for (final BlockingQueue<EndpointConnection> connectionQueue : connectionQueueMap.values()) { for (final BlockingQueue<EndpointConnection> connectionQueue : connectionQueueMap.values()) {
EndpointConnection state; EndpointConnection state;
while ((state = connectionQueue.poll()) != null) { while ((state = connectionQueue.poll()) != null) {
cleanup(state.getSocketClientProtocol(), state.getPeer()); terminate(state);
} }
} }
} }
public void terminate(final EndpointConnection connection) { public void terminate(final EndpointConnection connection) {
activeConnections.remove(connection);
cleanup(connection.getSocketClientProtocol(), connection.getPeer()); cleanup(connection.getSocketClientProtocol(), connection.getPeer());
} }