Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added limit on how long client pool can be exhausted
  • Loading branch information
shaunkalley committed Sep 6, 2013
2 parents c0efcab + 0f8f672 commit 2116f5d
Showing 1 changed file with 5 additions and 9 deletions.
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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() ) {
Expand Down

0 comments on commit 2116f5d

Please sign in to comment.