diff --git a/mutation_reader.cc b/mutation_reader.cc index 90fdfc2ee5..f5b0f59093 100644 --- a/mutation_reader.cc +++ b/mutation_reader.cc @@ -1645,11 +1645,15 @@ future<> shard_reader::close() noexcept { co_return; } - try { - if (_read_ahead) { + if (_read_ahead) { + try { co_await *std::exchange(_read_ahead, std::nullopt); + } catch (...) { + mrlog.warn("shard_reader::close(): read_ahead on shard {} failed: {}", _shard, std::current_exception()); } + } + try { co_await smp::submit_to(_shard, [this] { auto irh = std::move(*_reader).inactive_read_handle(); return with_closeable(flat_mutation_reader(_reader.release()), [this] (flat_mutation_reader& reader) mutable {