Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fixing last commit's test failures #586

Merged
merged 1 commit into from

2 participants

@dmdevito

I have downloaded last hector's sources, and found some test failures.
According to my hector's src code understanding, I have tried to fix them + I have have modified a non-appropriate log comment
See my fixes.

@zznate zznate merged commit 310c83d into hector-client:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 18, 2013
  1. @dmdevito
This page is out of date. Refresh to see the latest.
View
14 core/src/main/java/me/prettyprint/cassandra/connection/ConcurrentHClientPool.java
@@ -71,12 +71,14 @@ public HClient borrowClient() throws HectorException {
int currentActiveClients = activeClientsCount.incrementAndGet();
try {
- if (cassandraClient.getCassandraHost().getMaxConnectTimeMillis() > 0
- && System.currentTimeMillis() - cassandraClient.getCreatedTime() > cassandraClient.getCassandraHost().getMaxConnectTimeMillis()) {
- log.info("Closing connection to {} due to idle time of {} ms", cassandraClient.getCassandraHost().getHost(),
- System.currentTimeMillis() - cassandraClient.getCreatedTime());
- cassandraClient.close();
- cassandraClient = null;
+ if (cassandraClient != null) {
+ if (cassandraClient.getCassandraHost().getMaxConnectTimeMillis() > 0
+ && System.currentTimeMillis() - cassandraClient.getCreatedTime() > cassandraClient.getCassandraHost().getMaxConnectTimeMillis()) {
+ log.info("Closing connection to {} due to too long existence time of {} ms", cassandraClient.getCassandraHost().getHost(),
+ System.currentTimeMillis() - cassandraClient.getCreatedTime());
+ cassandraClient.close();
+ cassandraClient = null;
+ }
}
if ( cassandraClient == null ) {
Something went wrong with that request. Please try again.