Skip to content

Commit

Permalink
cassandra: Treat "Request timed out" also as SQL_RESULT_ERROR_TYPE_WR…
Browse files Browse the repository at this point in the history
…ITE_UNCERTAIN

CASS_ERROR_SERVER_WRITE_TIMEOUT is "Write timeout" as reported by Cassandra
server, while CASS_ERROR_LIB_REQUEST_TIMED_OUT is timeout as reported by the
Cassandra library.
  • Loading branch information
sirainen authored and GitLab committed Dec 7, 2016
1 parent b363b99 commit b8eb321
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib-sql/driver-cassandra.c
Expand Up @@ -736,7 +736,8 @@ static void query_callback(CassFuture *future, void *context)
i_free(result->error);

msecs = timeval_diff_msecs(&ioloop_timeval, &result->start_time);
result->api.error_type = error == CASS_ERROR_SERVER_WRITE_TIMEOUT ?
result->api.error_type = error == CASS_ERROR_SERVER_WRITE_TIMEOUT ||
error == CASS_ERROR_LIB_REQUEST_TIMED_OUT ?
SQL_RESULT_ERROR_TYPE_WRITE_UNCERTAIN :
SQL_RESULT_ERROR_TYPE_UNKNOWN;
result->error = i_strdup_printf("Query '%s' failed: %.*s (in %u.%03u secs)",
Expand Down

0 comments on commit b8eb321

Please sign in to comment.