scylladb / scylla-rust-driver

Async CQL driver for Rust, optimized for ScyllaDB!
Apache License 2.0
583 stars 104 forks source link

Bug: driver never retries on Response::Error #501

Closed wprzytula closed 2 years ago

wprzytula commented 2 years ago

Problem:

When driver receives a response of type Error (e.g. ServerError or Overloaded), it prints "Query succeeded." and never retries, but the error is returned instantly (as if FallthroughRetryPolicy was used).

Steps to reproduce:

Forge an error response frame for driver's request.

Found cause:

In Session:execute_query() the Option<QueryResponse, QueryError> holds Response::Error as Ok and not Err variant, so pattern matching leads to returning that as successful result.

Proposed solution:

Get rid of Response::Error variant and make the aforementioned Option hold Error response as Err(QueryError) variant.

496 contains the proposed fix.

psarna commented 2 years ago

again, let's extract the fix out of #496 and merge it separately