sisungo / airup

🚀 Airup is a modern, portable and blazingly fast implementation of service supervisor and the init daemon.
MIT License
18 stars 1 forks source link

[BUG] Cannot query service while stopping it #27

Closed sisungo closed 7 months ago

sisungo commented 7 months ago

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.