mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-03 13:37:04 +00:00
sstables: remove_temp_dir: do not return then_wrapped future
f.get_exception makes the future invalid so it must not be returned. Instead, make_exception_future<> with the exception ptr. Fixes #4435. Signed-off-by: Benny Halevy <bhalevy@scylladb.com> Message-Id: <20190415111909.30499-1-bhalevy@scylladb.com>
This commit is contained in:
@@ -2531,12 +2531,13 @@ future<> sstable::remove_temp_dir() {
|
||||
}
|
||||
sstlog.debug("Removing temp_dir={}", _temp_dir);
|
||||
return remove_file(*_temp_dir).then_wrapped([this] (future<> f) {
|
||||
if (f.failed()) {
|
||||
sstlog.error("Could not remove temporary directory: {}", f.get_exception());
|
||||
} else {
|
||||
if (!f.failed()) {
|
||||
_temp_dir.reset();
|
||||
return make_ready_future<>();
|
||||
}
|
||||
return f;
|
||||
auto ep = f.get_exception();
|
||||
sstlog.error("Could not remove temporary directory: {}", ep);
|
||||
return make_exception_future<>(ep);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user