]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
cassandra: Treat "Request timed out" also as SQL_RESULT_ERROR_TYPE_WRITE_UNCERTAIN
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 6 Dec 2016 22:14:08 +0000 (00:14 +0200)
committerGitLab <gitlab@git.dovecot.net>
Wed, 7 Dec 2016 22:50:00 +0000 (00:50 +0200)
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.

src/lib-sql/driver-cassandra.c

index 9cbc4ed437fec9b759848b040cd050e63b408947..e037d191b64a3e6a1829bd79d5304cc172267874 100644 (file)
@@ -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)",