Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added limit on how long client pool can be exhausted

  • Loading branch information...
commit 31cbcc39f788de82d110951fe0706b99e6d83368 1 parent deeec00
@shaunkalley shaunkalley authored
View
14 core/src/main/java/me/prettyprint/cassandra/connection/HConnectionManager.java
@@ -271,11 +271,17 @@ public void operateWithFailover(Operation<?> op) throws HectorException {
client.close();
// TODO timecheck on how long we've been waiting on timeouts here
// suggestion per user moores on hector-users
- } else if ( he instanceof HPoolRecoverableException ) {
- if (he instanceof HPoolExhaustedException &&
- pool.getExhaustedTime() >= pool.getCassandraHost().getMaxExhaustedTimeBeforeSuspending()) {
- markHostAsDown(pool.getCassandraHost());
+ } else if (he instanceof HPoolExhaustedException) {
+ if (pool.getExhaustedTime() >= pool.getCassandraHost().getMaxExhaustedTimeBeforeSuspending()) {
+ suspendCassandraHost(pool.getCassandraHost());
+ if (hostPools.isEmpty()) {
+ throw he;
+ }
+ retryable = op.failoverPolicy.shouldRetryFor(HPoolExhaustedException.class);
+ excludeHosts.add(pool.getCassandraHost());
+ monitor.incCounter(Counter.POOL_EXHAUSTED);
}
+ } else if ( he instanceof HPoolRecoverableException ) {
retryable = op.failoverPolicy.shouldRetryFor(HPoolRecoverableException.class);;
if ( hostPools.size() == 1 ) {
throw he;
Please sign in to comment.
Something went wrong with that request. Please try again.