Currently, the query implementation in the supervisor .await-s on the child lock, which is unavailable during some tasks (e.g. stop). Even worth, it causes the main supervisor task unresponsable.
It may be a solution: use try_lock() instead of locking. If it succeeded, main PID is normally returned, otherwise something like (???) is returned.
However, that's not a perfect solution. Can it (the Option<Child>) be refactored using atomics? The Child itself is already atomic, but it's unknown how to replace Option now.
Currently, the
query
implementation in the supervisor.await
-s on the child lock, which is unavailable during some tasks (e.g. stop). Even worth, it causes the main supervisor task unresponsable.It may be a solution: use
try_lock()
instead of locking. If it succeeded, main PID is normally returned, otherwise something like(???)
is returned.However, that's not a perfect solution. Can it (the
Option<Child>
) be refactored using atomics? TheChild
itself is already atomic, but it's unknown how to replaceOption
now.