@Override public OperationTimedOutException copy() { return new OperationTimedOutException(address, getRawMessage(), this); } }
logError( connection.address, new OperationTimedOutException( connection.address, "Timed out waiting for response to PREPARE message")); retry(false, null);
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { assert connection != null; // We always timeout on a specific connection, so this shouldn't be null this.address = connection.address; return super.setException(new OperationTimedOutException(connection.address)); }
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { // This is only called for internal calls (i.e, when the future is not wrapped in // RequestHandler). // So just set an exception for the final result, which should be handled correctly by said // internal call. setException(new OperationTimedOutException(connection.address)); return true; }
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { QueryState queryState = queryStateRef.get(); if (!queryState.isInProgressAt(retryCount) || !queryStateRef.compareAndSet(queryState, queryState.complete())) { logger.debug( "onTimeout triggered but the response was completed by another thread, cancelling (retryCount = {}, queryState = {}, queryStateRef = {})", retryCount, queryState, queryStateRef.get()); return false; } connection.release(); logError( connection.address, new OperationTimedOutException( connection.address, "Timed out waiting for response to PREPARE message")); retry(false, null); return true; } };
new OperationTimedOutException( connection.address, "Timed out waiting for server response");
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { // This is only called for internal calls (i.e, when the future is not wrapped in RequestHandler). // So just set an exception for the final result, which should be handled correctly by said internal call. setException(new OperationTimedOutException(connection.address)); return true; }
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { assert connection != null; // We always timeout on a specific connection, so this shouldn't be null this.address = connection.address; return super.setException(new OperationTimedOutException(connection.address)); }
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { assert connection != null; // We always timeout on a specific connection, so this shouldn't be null this.address = connection.address; return super.setException(new OperationTimedOutException(connection.address)); }
@Override public OperationTimedOutException copy() { return new OperationTimedOutException(address, getRawMessage(), this); }
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { // This is only called for internal calls (i.e, when the future is not wrapped in RequestHandler). // So just set an exception for the final result, which should be handled correctly by said internal call. setException(new OperationTimedOutException(connection.address)); return true; }
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { // This is only called for internal calls (i.e, when the future is not wrapped in RequestHandler). // So just set an exception for the final result, which should be handled correctly by said internal call. setException(new OperationTimedOutException(connection.address)); return true; }
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { assert connection != null; // We always timeout on a specific connection, so this shouldn't be null this.address = connection.address; return super.setException(new OperationTimedOutException(connection.address)); }
@Override public OperationTimedOutException copy() { return new OperationTimedOutException(address, getRawMessage(), this); }
@Override public OperationTimedOutException copy() { return new OperationTimedOutException(address, getRawMessage(), this); }
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { QueryState queryState = queryStateRef.get(); if (!queryState.isInProgressAt(retryCount) || !queryStateRef.compareAndSet(queryState, queryState.complete())) { logger.debug("onTimeout triggered but the response was completed by another thread, cancelling (retryCount = {}, queryState = {}, queryStateRef = {})", retryCount, queryState, queryStateRef.get()); return false; } connection.release(); logError(connection.address, new OperationTimedOutException(connection.address, "Timed out waiting for response to PREPARE message")); retry(false, null); return true; } };
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { QueryState queryState = queryStateRef.get(); if (!queryState.isInProgressAt(retryCount) || !queryStateRef.compareAndSet(queryState, queryState.complete())) { logger.debug("onTimeout triggered but the response was completed by another thread, cancelling (retryCount = {}, queryState = {}, queryStateRef = {})", retryCount, queryState, queryStateRef.get()); return false; } connection.release(); logError(connection.address, new OperationTimedOutException(connection.address, "Timed out waiting for response to PREPARE message")); retry(false, null); return true; } };
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { QueryState queryState = queryStateRef.get(); if (!queryState.isInProgressAt(retryCount) || !queryStateRef.compareAndSet(queryState, queryState.complete())) { logger.debug("onTimeout triggered but the response was completed by another thread, cancelling (retryCount = {}, queryState = {}, queryStateRef = {})", retryCount, queryState, queryStateRef.get()); return false; } connection.release(); logError(connection.address, new OperationTimedOutException(connection.address, "Timed out waiting for response to PREPARE message")); retry(false, null); return true; } };
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { QueryState queryState = queryStateRef.get(); if (!queryState.isInProgressAt(retryCount) || !queryStateRef.compareAndSet(queryState, queryState.complete())) { logger.debug("onTimeout triggered but the response was completed by another thread, cancelling (retryCount = {}, queryState = {}, queryStateRef = {})", retryCount, queryState, queryStateRef.get()); return false; } Host queriedHost = current; OperationTimedOutException timeoutException = new OperationTimedOutException(connection.address, "Timed out waiting for server response"); try { connection.release(); RetryPolicy.RetryDecision decision = computeRetryDecisionOnRequestError(timeoutException); processRetryDecision(decision, connection, timeoutException); } catch (Exception e) { // This shouldn't happen, but if it does, we want to signal the callback, not let it hang indefinitely setFinalException(null, new DriverInternalError("An unexpected error happened while handling timeout", e)); } finally { if (queriedHost != null && statement != Statement.DEFAULT) manager.cluster.manager.reportQuery(queriedHost, statement, timeoutException, latency); } return true; }
@Override public boolean onTimeout(Connection connection, long latency, int retryCount) { QueryState queryState = queryStateRef.get(); if (!queryState.isInProgressAt(retryCount) || !queryStateRef.compareAndSet(queryState, queryState.complete())) { logger.debug("onTimeout triggered but the response was completed by another thread, cancelling (retryCount = {}, queryState = {}, queryStateRef = {})", retryCount, queryState, queryStateRef.get()); return false; } Host queriedHost = current; OperationTimedOutException timeoutException = new OperationTimedOutException(connection.address, "Timed out waiting for server response"); try { connection.release(); RetryPolicy.RetryDecision decision = computeRetryDecisionOnRequestError(timeoutException); processRetryDecision(decision, connection, timeoutException); } catch (Exception e) { // This shouldn't happen, but if it does, we want to signal the callback, not let it hang indefinitely setFinalException(null, new DriverInternalError("An unexpected error happened while handling timeout", e)); } finally { if (queriedHost != null && statement != Statement.DEFAULT) manager.cluster.manager.reportQuery(queriedHost, statement, timeoutException, latency); } return true; }