base: exit loop on cpu session close

if session can't be closed immediately, e.g. if the service is provided by
a child (cpu_balancer) and not by the parent.

Issue #4029
This commit is contained in:
Alexander Boettcher 2021-03-11 15:17:49 +01:00 committed by Norman Feske
parent 8eb514d6b5
commit 18182b11da

View File

@ -870,8 +870,13 @@ void Child::close_all_sessions()
* warnings generated by threads that are losing their PD while still
* running.
*/
while (unsigned long id_value = any_cpu_session_id(_id_space).value)
(void)close(Parent::Client::Id{id_value});
while (unsigned long id_value = any_cpu_session_id(_id_space).value) {
Close_result const close_result = close(Parent::Client::Id{id_value});
/* break infinte loop if CPU session is provided by a child */
if (close_result != CLOSE_DONE)
break;
}
_initial_thread.destruct();