mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 19:21:01 +00:00
repair: row_level: coroutinize repair_meta::get_full_row_hashes_sink_op()
Extra care is needed for exception handling.
This commit is contained in:
@@ -1530,13 +1530,17 @@ private:
|
||||
}
|
||||
|
||||
future<> get_full_row_hashes_sink_op(rpc::sink<repair_stream_cmd>& sink) {
|
||||
return sink(repair_stream_cmd::get_full_row_hashes).then([&sink] {
|
||||
return sink.flush();
|
||||
}).handle_exception([&sink] (std::exception_ptr ep) {
|
||||
return sink.close().then([ep = std::move(ep)] () mutable {
|
||||
return make_exception_future<>(std::move(ep));
|
||||
});
|
||||
});
|
||||
std::exception_ptr ep;
|
||||
try {
|
||||
co_await sink(repair_stream_cmd::get_full_row_hashes);
|
||||
co_await sink.flush();
|
||||
} catch (...) {
|
||||
ep = std::current_exception();
|
||||
}
|
||||
if (ep) {
|
||||
co_await sink.close();
|
||||
std::rethrow_exception(ep);
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user