2
votes

As per this flow : Cassandra read_request_timeout_in_ms set up for external(Client) request , I understand that setting the timeout in server side is not just enough, we need to set in client side too.

What is the difference between setting timeout in client and server side?

Example :

          Setting the request time out in server side in Cassandra (cassandra.yaml)
                                 VS
          Setting the request time out in client side in Cassandra driver 

EDITED :

driver read timeout: the driver did not receive any response from the current coordinator within SocketOptions.setReadTimeoutMillis. It invokes onRequestError on the retry policy with an OperationTimedOutException to decide what to do.
server read timeout: the driver did receive a response, but that response indicates that the coordinator timed out while waiting for other replicas. It invokes onReadTimeout on the retry policy to decide what to do.

Could somebody clearly explain the purpose and difference between both please.

1

1 Answers

0
votes

Setting the timeout at server-side i.e in cassandra.yaml is not the same as setting the driver (aka client-side) timeout using SocketOptions.setReadTimeoutMillis. They both work individually. One does not over-ride the other. In general, you should set driver timeout slightly larger than server-side timeout.

  1. If Cassandra node is reachable and working but it's not able to respond within read time mentioned in cassandra.yaml it'll throw an exception and driver will get the same exception. The driver might retry if configured.
  2. If Cassandra node does not respond due to some reason, the driver can't wait indefinitely. That's when driver timeout kicks in and throws exception if Cassandra is not responding.