view_builder: Always resolve started future to success

If the view builder background start fails, the _started future resolves
to exceptional state. In turn, stopping the view builder keeps this state
through .finally() and aborts the shutdown very early, while it may and
should proceed.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2020-08-24 13:38:21 +03:00
parent 60e21bb59a
commit 8f8ed625ab

View File

@@ -1278,6 +1278,9 @@ future<> view_builder::start(service::migration_manager& mm) {
(void)_build_step.trigger();
return make_ready_future<>();
});
}).handle_exception([] (std::exception_ptr eptr) {
vlogger.error("start failed: {}", eptr);
return make_ready_future<>();
});
return make_ready_future<>();
}
@@ -1285,7 +1288,7 @@ future<> view_builder::start(service::migration_manager& mm) {
future<> view_builder::stop() {
vlogger.info("Stopping view builder");
_as.request_abort();
return _started.finally([this] {
return _started.then([this] {
return _mnotifier.unregister_listener(this).then([this] {
return _sem.wait();
}).then([this] {