Permalink
Browse files

fix for timed out sockets

  • Loading branch information...
1 parent f12619a commit 6685d5ca665e898942ba78f2b8d91695892c1b7d @tjake committed Dec 10, 2010
Showing with 4 additions and 2 deletions.
  1. +1 −1 src/lucandra/CassandraProxyClient.java
  2. +3 −1 src/lucandra/CassandraUtils.java
View
2 src/lucandra/CassandraProxyClient.java
@@ -225,7 +225,7 @@ public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
if(breaker.allow()){
result = m.invoke(client, args);
breaker.success();
- return result;
+ return result;
}else{
while(!breaker.allow()){
Thread.sleep(1050); //sleep and try again
View
4 src/lucandra/CassandraUtils.java
@@ -373,7 +373,9 @@ public static void robustBatchInsert(Cassandra.Iface client, Map<String,Map<Stri
mutationMap.clear();
//if(logger.isDebugEnabled())
// logger.debug("Inserted in " + (startTime - System.currentTimeMillis()) / 1000 + "ms");
- } catch (TException e) {
+ } catch(TTransportException e) {
+ try_again = true;
+ } catch (TException e) {
throw new RuntimeException(e);
} catch (InvalidRequestException e) {
throw new RuntimeException(e);

0 comments on commit 6685d5c

Please sign in to comment.