main: stop view builder conditionally

The view builder is started only if it's enabled in config,
via the view_building=true variable. Unfortunately, stopping
the builder was unconditional, which may result in failed
assertions during shutdown. To remedy this, view building
is stopped only if it was previously started.

Fixes #4589

(cherry picked from commit efa7951ea5)
This commit is contained in:
Piotr Sarna
2019-06-24 12:23:58 +02:00
committed by Avi Kivity
parent 773bf45774
commit 9b2ca4ee44

View File

@@ -763,8 +763,11 @@ int main(int ac, char** av) {
return service::get_local_storage_service().drain_on_shutdown();
});
engine().at_exit([] {
return view_builder.stop();
engine().at_exit([cfg] {
if (cfg->view_building()) {
return view_builder.stop();
}
return make_ready_future<>();
});
engine().at_exit([&db] {