base: close PD session last when destructing child

This patch moves the destruction of the child's PD session after the
closing of all other sessions because the PD session's role as resource
container might still be needed for orderly reverting the session quotas
when closing the other remaining sessions.

Issue #4917
This commit is contained in:
Norman Feske 2023-06-07 12:25:43 +02:00
parent 734fc252e8
commit 0d5571a820

View File

@ -889,7 +889,6 @@ void Child::close_all_sessions()
_binary.close();
if (_linker.constructed())
_linker->close();
_pd.close();
/*
* Remove statically created env sessions from the child's ID space.
@ -915,6 +914,8 @@ void Child::close_all_sessions()
while (_id_space.apply_any<Session_state>(close_fn));
_pd.close();
if (!KERNEL_SUPPORTS_EAGER_CHILD_DESTRUCTION)
_cpu._connection.destruct();
}