commitlog::read_log_file: Preserve subscription across reading
Fixes #6265 Return type for read_log_file was previously changed from subscription to future<>, returning the previously returned subscriptions result of done(). But it did not preserve the subscription itself, which in turn will cause us to (in work::stream), call back into a deleted object. Message-Id: <20200422090856.5218-1-calle@scylladb.com>
This commit is contained in:
@@ -2139,8 +2139,9 @@ db::commitlog::read_log_file(const sstring& filename, const sstring& pfx, seasta
|
||||
}).handle_exception([w](auto ep) {
|
||||
w->s.set_exception(ep);
|
||||
});
|
||||
|
||||
return ret.done();
|
||||
// #6265 - must keep subscription alive.
|
||||
auto res = ret.done();
|
||||
return res.finally([ret = std::move(ret)] {});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user