mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-20 16:40:35 +00:00
data_consume_rows_context needs to have close() called and the returned future waited for before it can be destroyed. data_consume_context::impl does that in the background upon its destruction. However, it is possible that the sstable is removed before data_consume_rows_context::close() completes in which case EBADF may happen. The solution is to make data_consume_context::impl keep a reference to the sstable and extend its life time until closing of data_consume_rows_context (which is performed in the background) completes. Side effect of this change is also that data_consume_context no longer requires its user to make sure that the sstable exists as long as it is in use since it owns its own reference to it. Fixes #1537. Signed-off-by: Paweł Dziepak <pdziepak@scylladb.com> Message-Id: <1470222225-19948-1-git-send-email-pdziepak@scylladb.com>