diff --git a/cql3/statements/batch_statement.cc b/cql3/statements/batch_statement.cc index e2d52538c3d7..14815cdb9191 100644 --- a/cql3/statements/batch_statement.cc +++ b/cql3/statements/batch_statement.cc @@ -59,8 +59,8 @@ timeout_for_type(batch_statement::type t) { : &timeout_config::write_timeout; } -db::timeout_clock::duration batch_statement::get_timeout(const query_options& options) const { - return _attrs->is_timeout_set() ? _attrs->get_timeout(options) : options.get_timeout_config().*get_timeout_config_selector(); +db::timeout_clock::duration batch_statement::get_timeout(const service::client_state& state, const query_options& options) const { + return _attrs->is_timeout_set() ? _attrs->get_timeout(options) : state.get_timeout_config().*get_timeout_config_selector(); } batch_statement::batch_statement(int bound_terms, type type_, @@ -290,7 +290,7 @@ future> batch_statement::do_ ++_stats.batches; _stats.statements_in_batches += _statements.size(); - auto timeout = db::timeout_clock::now() + get_timeout(options); + auto timeout = db::timeout_clock::now() + get_timeout(query_state.get_client_state(), options); return get_mutations(storage, options, timeout, local, now, query_state).then([this, &storage, &options, timeout, tr_state = query_state.get_trace_state(), permit = query_state.get_permit()] (std::vector ms) mutable { return execute_without_conditions(storage, std::move(ms), options.get_consistency(), timeout, std::move(tr_state), std::move(permit)); @@ -347,7 +347,7 @@ future> batch_statement::exe schema_ptr schema; db::timeout_clock::time_point now = db::timeout_clock::now(); - const timeout_config& cfg = options.get_timeout_config(); + const timeout_config& cfg = qs.get_client_state().get_timeout_config(); auto batch_timeout = now + cfg.write_timeout; // Statement timeout. auto cas_timeout = now + cfg.cas_timeout; // Ballot contention timeout. auto read_timeout = now + cfg.read_timeout; // Query timeout. diff --git a/cql3/statements/batch_statement.hh b/cql3/statements/batch_statement.hh index 9d7970765c41..1cd3b2eee1ef 100644 --- a/cql3/statements/batch_statement.hh +++ b/cql3/statements/batch_statement.hh @@ -171,7 +171,7 @@ private: const query_options& options, service::query_state& state) const; - db::timeout_clock::duration get_timeout(const query_options& options) const; + db::timeout_clock::duration get_timeout(const service::client_state& state, const query_options& options) const; public: // FIXME: no cql_statement::to_string() yet #if 0