Permalink
Browse files

added limit on how long client pool can be exhausted

  • Loading branch information...
2 parents c0efcab + 0f8f672 commit 2116f5da170ce9bbd24b19dc6950979bca4873b5 @shaunkalley shaunkalley committed Sep 6, 2013
View
14 core/src/main/java/me/prettyprint/cassandra/connection/ConcurrentHClientPool.java
@@ -121,11 +121,9 @@ public HClient borrowClient() throws HectorException {
throw e;
}
- synchronized (this) {
- realActiveClientsCount.incrementAndGet();
- if (isExhausted()) {
- exhaustedStartTime.set(System.currentTimeMillis());
- }
+ realActiveClientsCount.incrementAndGet();
+ if (isExhausted()) {
+ exhaustedStartTime.set(System.currentTimeMillis());
}
return cassandraClient;
}
@@ -288,10 +286,8 @@ public void releaseClient(HClient client) throws HectorException {
}
}
- synchronized (this) {
- realActiveClientsCount.decrementAndGet();
- exhaustedStartTime.set(-1);
- }
+ realActiveClientsCount.decrementAndGet();
+ exhaustedStartTime.set(-1);
activeClientsCount.decrementAndGet();
if ( log.isTraceEnabled() ) {

0 comments on commit 2116f5d

Please sign in to comment.