chipsenkbeil / distant

🚧 (Alpha stage software) Library and tooling that supports remote filesystem and process operations. 🚧

Home Page:https://distant.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zombie process when server terminates that was spawned via `distant launch manager://localhost`

chipsenkbeil opened this issue · comments

  1. Start a manager using distant manager listen
  2. In another terminal, launch a server via distant launch manager://localhost --distant-args '--shutdown after=5'

Wait 5 seconds and observe that we now get a zombie process, which goes away if you kill the manager. This indicates that the manager is supposed to be reading the exit status of the process, has not done so, and thus there is a zombie.

Same thing happens if you use --shutdown lonely=5 and kill the connection with distant manager kill <id>.

There is no zombie when using distant launch ssh://localhost --distant-args '--shutdown after=5'.

I think this may be due to us holding onto the server child process within the manager launch handler.

image image

We would need to revise this handler to spawn a task that waits for the child to exit and then removes it from the list of children, which means that we also need to have an arbitrary id used - so hashmap instead of vec.

Resolved by 9e48300.

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.