janusgraph
janusgraph copied to clipboard
Cassandra node down - Broken pipe not recovering connection
I noticed when my cassandra node is down or a network issue happens, Titan (now JanusGraph) wouldn't recover the connection, for the stack below it seems a Thrift issue but with some try/catch we could make try to reconnect when the network is back up...
2017-01-23 11:28:38.047 WARN 51233 --- [pool-4-thread-1] c.t.titan.diskstorage.log.kcvs.KCVSLog : Could not read messages for timestamp [2017-01-21T16:20:00Z] (this read will be retried)
com.thinkaurelius.titan.core.TitanException: Could not execute operation due to backend exception
at com.thinkaurelius.titan.diskstorage.util.BackendOperation.execute(BackendOperation.java:44) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.util.BackendOperation.execute(BackendOperation.java:144) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLog$MessagePuller.run(KCVSLog.java:703) ~[titan-core-1.0.0.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_25]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_25]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_25]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_25]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_25]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_25]
Caused by: com.thinkaurelius.titan.diskstorage.PermanentBackendException: Permanent failure in storage backend
at com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftKeyColumnValueStore.convertException(CassandraThriftKeyColumnValueStore.java:249) ~[titan-cassandra-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftKeyColumnValueStore.getNamesSlice(CassandraThriftKeyColumnValueStore.java:148) ~[titan-cassandra-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftKeyColumnValueStore.getNamesSlice(CassandraThriftKeyColumnValueStore.java:91) ~[titan-cassandra-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftKeyColumnValueStore.getSlice(CassandraThriftKeyColumnValueStore.java:80) ~[titan-cassandra-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLog$MessagePuller$1.call(KCVSLog.java:769) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.log.kcvs.KCVSLog$MessagePuller$1.call(KCVSLog.java:766) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.util.BackendOperation.execute(BackendOperation.java:133) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.util.BackendOperation$1.call(BackendOperation.java:147) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.util.BackendOperation.executeDirect(BackendOperation.java:56) ~[titan-core-1.0.0.jar:na]
at com.thinkaurelius.titan.diskstorage.util.BackendOperation.execute(BackendOperation.java:42) ~[titan-core-1.0.0.jar:na]
... 9 common frames omitted
Caused by: org.apache.thrift.transport.TTransportException: java.net.SocketException: Broken pipe
at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:147) ~[libthrift-0.9.2.jar:0.9.2]
at org.apache.thrift.transport.TFramedTransport.flush(TFramedTransport.java:156) ~[libthrift-0.9.2.jar:0.9.2]
at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:65) ~[libthrift-0.9.2.jar:0.9.2]
at org.apache.cassandra.thrift.Cassandra$Client.send_multiget_slice(Cassandra.java:735) ~[cassandra-thrift-2.1.9.jar:2.1.9]
at org.apache.cassandra.thrift.Cassandra$Client.multiget_slice(Cassandra.java:724) ~[cassandra-thrift-2.1.9.jar:2.1.9]
at com.thinkaurelius.titan.diskstorage.cassandra.thrift.CassandraThriftKeyColumnValueStore.getNamesSlice(CassandraThriftKeyColumnValueStore.java:129) ~[titan-cassandra-1.0.0.jar:na]
... 17 common frames omitted
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method) ~[na:1.8.0_25]
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) ~[na:1.8.0_25]
at java.net.SocketOutputStream.write(SocketOutputStream.java:153) ~[na:1.8.0_25]
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) ~[na:1.8.0_25]
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126) ~[na:1.8.0_25]
at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:145) ~[libthrift-0.9.2.jar:0.9.2]
... 22 common frames omitted
PR #112 was merged, which fixes this issue.