Permalink
Browse files

Merge pull request #586 from dmdevito/testfailures

fixing last commit's test failures
  • Loading branch information...
2 parents 7cf189b + 27ac83a commit 310c83d83567caf9ab4884a23f5fafbb4f0b1bdd @zznate zznate committed Feb 20, 2013
@@ -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 ) {

0 comments on commit 310c83d

Please sign in to comment.