ajaxorg/cloud9 — pull request #2060 by lennartcl (2012-08-18 13:49:30+00:00)
Title: [Liskov] Fix processes not terminating and ghost processes

This should address #2206 and #2253.

There were a number of problems surrounding processes and debugging:

- if the SSH process died or the connection got lost, Cloud9 would assume the child processes still lived
- if a process didn't respond to SIGTERM, it was unkillable
- if killing a process failed, the error handling callback was never invoked
- if a process could not be killed or did not exist, it would never disappear from the UI

This resulted in users often getting in a state were the UI lists ghost processes without any means to get rid of them.

This patch does three things:

- removes processes from the server's process manager when they were killed, successfully or unsuccessfully
- marks processes as killed in the UI, even if the the process is already dead or the SSH process dies
- sends a hard SIGKILL signal to kill processes dead

@ajaxorg/liskov

CC @creationix: note that this doesn't include the latest VFS changes or propagate the "error" event; I'm taking a different approach to allow recovery from this state. The "error" stuff could be a future improvement.