rantav/hector — Issue #434: SocketTimeoutException should be translated as HectorTransportException
Author: sbridges
Created: 2012-03-07 22:01:14+00:00
State: open
Labels: bug

In ExceptionTranslator, org.apache.cassandra.thrift.TimedOutException and java.net.SocketTimeoutException are both translated as HTimedoutException.

I don't think it makes sense to translate these the same. TimedOutException is thrown by cassandra when an rpc call takes longer than the configurable timeout, while SocketTimeoutException is a networking issue.

We had an issue where hector would hang when one of our cass machines was powered down, as by default it looks like we retry HTimedOutExceptions forever.

I think it makes more sense to translate SocketTimeoutException as a HectorTransportException, which would correctly mark the host as down.

If you agree, I can submit a patch.