mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-23 01:50:35 +00:00
When using interposers, cancelling compactions can leave futures that are not waited for (resharding, twcs) The reason is when consume_end_of_stream gets called, it tries to push end_of_stream into the queue_reader_handle. Because cancelling a compaction is done through an exception, the queue_reader_handle is terminated already at this time. Trying to push to it generates another exception and prevents us from returning the future right below it. This patch adds a new method is_terminated() and if we detect that the queue_reader_handle is already terminated by this point, we don't try to push. We call it is_terminated() because the check is to see if the queue_reader_handle has a _reader. The reader is also set to null on successful destruction. Signed-off-by: Glauber Costa <glauber@scylladb.com> Reviewed-by: Botond Dénes <bdenes@scylladb.com> Message-Id: <20200430175839.8292-1-glauber@scylladb.com>