main: make sure view_builder doesn't propagate semaphore errors
Stopping services which occurs in a destructor of deferred_action should not throw, or it will end the program with terminate(). View builder breaks a semaphore during its shutdown, which results in propagating a broken_semaphore exception, which in turn results in throwing an exception during stop().get(). In order to fix that issue, semaphore exceptions are explicitly ignored, since they're expected to appear during shutdown. Fixes #4875
This commit is contained in:
committed by
Nadav Har'El
parent
c8f8a9450f
commit
23c891923e
@@ -1164,6 +1164,10 @@ future<> view_builder::stop() {
|
||||
return _sem.wait().then([this] {
|
||||
_sem.broken();
|
||||
return _build_step.join();
|
||||
}).handle_exception_type([] (const broken_semaphore&) {
|
||||
// ignored
|
||||
}).handle_exception_type([] (const semaphore_timed_out&) {
|
||||
// ignored
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user