private synchronized void closeSession(State finalState) { if (isAborted.compareAndSet(false, true)) { state(finalState); if (finalState == State.FAILED) { for (StreamTask task : Iterables.concat(receivers.values(), transfers.values())) task.abort(); } if (keepAliveFuture != null) { logger.debug("[Stream #{}] Finishing keep-alive task.", planId()); keepAliveFuture.cancel(false); keepAliveFuture = null; } // Note that we shouldn't block on this close because this method is called on the handler // incoming thread (so we would deadlock). handler.close(); streamResult.handleSessionComplete(this); } }
private synchronized void closeSession(State finalState) { if (isAborted.compareAndSet(false, true)) { state(finalState); if (finalState == State.FAILED) { for (StreamTask task : Iterables.concat(receivers.values(), transfers.values())) task.abort(); } if (keepAliveFuture != null) { logger.debug("[Stream #{}] Finishing keep-alive task.", planId()); keepAliveFuture.cancel(false); keepAliveFuture = null; } // Note that we shouldn't block on this close because this method is called on the handler // incoming thread (so we would deadlock). handler.close(); streamResult.handleSessionComplete(this); } }
private synchronized void closeSession(State finalState) { if (isAborted.compareAndSet(false, true)) { state(finalState); if (finalState == State.FAILED) { for (StreamTask task : Iterables.concat(receivers.values(), transfers.values())) task.abort(); } // Note that we shouldn't block on this close because this method is called on the handler // incoming thread (so we would deadlock). handler.close(); streamResult.handleSessionComplete(this); } }
private synchronized void closeSession(State finalState) { if (isAborted.compareAndSet(false, true)) { state(finalState); if (finalState == State.FAILED) { for (StreamTask task : Iterables.concat(receivers.values(), transfers.values())) task.abort(); } if (keepAliveFuture != null) { logger.debug("[Stream #{}] Finishing keep-alive task.", planId()); keepAliveFuture.cancel(false); keepAliveFuture = null; } // Note that we shouldn't block on this close because this method is called on the handler // incoming thread (so we would deadlock). handler.close(); streamResult.handleSessionComplete(this); } }