From a9d91a2d09292dd4c22b57bd774a1925802fd717 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Tue, 19 Jan 2021 18:44:40 +0200 Subject: [PATCH] mutation_writer: update bucket/shard writers consume_end_of_stream After 61520a33d64687477934f8f011efe4300dff3bca feed_writers doesn't call consume_end_of_stream after abort() so no need to test if (!_handle.is_terminated()) { and consume_end_of_stream is now called in then_wrapped rather than `finally` so it's ok if it throws. Signed-off-by: Benny Halevy --- mutation_writer/shard_based_splitting_writer.cc | 8 +------- mutation_writer/timestamp_based_splitting_writer.cc | 4 +--- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/mutation_writer/shard_based_splitting_writer.cc b/mutation_writer/shard_based_splitting_writer.cc index 238a622f09..86a29dbf90 100644 --- a/mutation_writer/shard_based_splitting_writer.cc +++ b/mutation_writer/shard_based_splitting_writer.cc @@ -48,13 +48,7 @@ class shard_based_splitting_mutation_writer { return _handle.push(std::move(mf)); } future<> consume_end_of_stream() { - // consume_end_of_stream is always called from a finally block, - // and that's because we wait for _consume_fut to return. We - // don't want to generate another exception here if the read was - // aborted. - if (!_handle.is_terminated()) { - _handle.push_end_of_stream(); - } + _handle.push_end_of_stream(); return std::move(_consume_fut); } void abort(std::exception_ptr ep) { diff --git a/mutation_writer/timestamp_based_splitting_writer.cc b/mutation_writer/timestamp_based_splitting_writer.cc index 350f53f8b3..b6cce9f504 100644 --- a/mutation_writer/timestamp_based_splitting_writer.cc +++ b/mutation_writer/timestamp_based_splitting_writer.cc @@ -139,9 +139,7 @@ class timestamp_based_splitting_mutation_writer { return _handle.push(std::move(mf)); } future<> consume_end_of_stream() { - if (!_handle.is_terminated()) { - _handle.push_end_of_stream(); - } + _handle.push_end_of_stream(); return std::move(_consume_fut); } void abort(std::exception_ptr ep) {