Autotest: Parallelize Aborting so that Large Aborts are faster
Currently when we try to abort a large number of jobs, the process
is slow as for each PID we try to kill, we send the first signal,
wait 6 seconds, send the next signal and once its dead we go onto
the next PID.
In order to speed up this process now we queue up all the processes
we want to kill on a given tick, send them all the first kill signal,
wait 6 seconds, then send them all the next kill signal.
BUG=chromium-os:35246
TEST=Ran on my local machine/scheduler and tested that multiple aborts
indeed run faster and still kill the PID's as expected.
Change-Id: I3d9f0ffd97142aeadd99295934b83bc624a1278d
Reviewed-on: https://gerrit.chromium.org/gerrit/35453
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Ready: Simran Basi <sbasi@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
diff --git a/scheduler/site_drone_manager.py b/scheduler/site_drone_manager.py
index febe2b7..50a63bc 100644
--- a/scheduler/site_drone_manager.py
+++ b/scheduler/site_drone_manager.py
@@ -39,3 +39,12 @@
copy_parse_log_back or not parse_log):
super(SiteDroneManager, self).copy_to_results_repository(process,
source_path, destination_path)
+
+
+ def kill_process(self, process):
+ """
+ Kill the given process.
+ """
+ logging.info('killing %s', process)
+ drone = self._get_drone_for_process(process)
+ drone.queue_kill_process(process)
\ No newline at end of file