Reputation: 151
I am new to cassandra just knows basics of it. I am facing frequent exceptions in cassandra. I'm using the thrift API single node cassandra. Mainly I am doing writes but those involves existing check.
I tried increasing read_request_timeout_in_ms
from 10s to a very large no: 9480secs. Then also i got timeout errors. I do not know exact reason behind this.
Here is stacktrace :
org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out
at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.transport.TFastFramedTransport.readFrame(TFastFramedTransport.java:140)
at org.apache.thrift.transport.TFastFramedTransport.read(TFastFramedTransport.java:134)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:378)
at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297)
at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:204)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
at org.apache.cassandra.thrift.Cassandra$Client.recv_set_keyspace(Cassandra.java:531)
at org.apache.cassandra.thrift.Cassandra$Client.set_keyspace(Cassandra.java:518)
at at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:127)
... 25 more
Upvotes: 1
Views: 5929
Reputation: 19377
What's going on here is that you've told Cassandra to let your queries run for a long time, but you haven't told your Thrift client to wait that long for a reply from Cassandra.
But really, 10s is plenty of time. Don't change that. Instead, figure out why your queries are taking longer with tracing: http://www.datastax.com/dev/blog/tracing-in-cassandra-1-2
Additionally, you should check out the data modeling resources here: https://wiki.apache.org/cassandra/DataModel. Existance-check-before-write is a design smell.
Upvotes: 4