Abort child process groups with SIGKILL.

Currently we unnecessarily sleep for 12 seconds every time we kill a process.
Here's how it works:
  - Send SIGCONT to all processes.
  - If any are still running, wait 6 seconds.
  - Send SIGTERM to all processes.
  - If any are still running, wait 6 seconds.
  - Send SIGKILL to all processes.

There are several problems with the above algorithm:
  - SIGCONT doesn't cause processes to exit, so waiting 6 seconds after
    that is pointless.
  - After sending SIGTERM, we check for whether any of the processes are
    present immediately. This doesn't give children enough time to
    actually clean up.
  - We sleep for 6 seconds unconditionally without considering the fact
    that the processes might exit early.

Instead of doing this, I've just updating it to send SIGKILL to the
entire process group and not have any sleep statements.

BUG=chromium:432191
DEPLOY=scheduler
TEST=Set up local scheduler, verified timeouts still work.

Change-Id: Ie41d10d0605851df61dd07789d0d4afffd9eef01
Reviewed-on: https://chromium-review.googlesource.com/230323
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Prashanth B <beeps@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2 files changed