Permalink
Browse files

Properly notify the ClientRequestExecutorFactory when a Socket is des…

…troyed
  • Loading branch information...
1 parent c73d4c9 commit cf5686456200878378150f7f63b1db1c3eebbfee @ctasada committed Nov 8, 2012
@@ -247,20 +247,20 @@ public void close() throws VoldemortException {
blockingClientRequest.await();
return blockingClientRequest.getResult();
} catch(InterruptedException e) {
- clientRequestExecutor.close();
+ pool.getFactory().destroy(destination, clientRequestExecutor);
throw new UnreachableStoreException("Failure in " + operationName + " on "
+ destination + ": " + e.getMessage(), e);
} catch(IOException e) {
- clientRequestExecutor.close();
+ pool.getFactory().destroy(destination, clientRequestExecutor);
throw new UnreachableStoreException("Failure in " + operationName + " on "
+ destination + ": " + e.getMessage(), e);
} catch(IllegalStateException e) {
- clientRequestExecutor.close();
+ pool.getFactory().destroy(destination, clientRequestExecutor);
throw e;
} finally {
if(blockingClientRequest != null && !blockingClientRequest.isComplete()) {
// close the executor if we timed out
- clientRequestExecutor.close();
+ pool.getFactory().destroy(destination, clientRequestExecutor);
}
pool.checkin(destination, clientRequestExecutor);
}
@@ -90,8 +90,7 @@ public ClientRequestExecutorFactory(int selectors,
* Close the ClientRequestExecutor.
*/
- public void destroy(SocketDestination dest, ClientRequestExecutor clientRequestExecutor)
- throws Exception {
+ public void destroy(SocketDestination dest, ClientRequestExecutor clientRequestExecutor) {
clientRequestExecutor.close();
int numDestroyed = destroyed.incrementAndGet();

0 comments on commit cf56864

Please sign in to comment.