Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(723)

Unified Diff: server/server_job.py

Issue 6902033: Reduce load on autotest by cutting number of forks and parsers. (Closed) Base URL: ssh://gitrw.chromium.org:9222/autotest.git@master
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | server/server_job_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/server_job.py
diff --git a/server/server_job.py b/server/server_job.py
index 6b98dd28d658508b2d957205108275371a9dcee9..005de6174551c1516d3fbed7f074251306243b72 100644
--- a/server/server_job.py
+++ b/server/server_job.py
@@ -7,7 +7,7 @@ Copyright Martin J. Bligh, Andy Whitcroft 2007
"""
import getpass, os, sys, re, stat, tempfile, time, select, subprocess, platform
-import Queue, threading
+import multiprocessing
import traceback, shutil, warnings, fcntl, pickle, logging, itertools, errno
from autotest_lib.client.bin import sysinfo
from autotest_lib.client.common_lib import base_job
@@ -462,7 +462,8 @@ class base_server_job(base_job.base_job):
return success_machines
- def distribute_across_machines(self, tests, machines):
+ def distribute_across_machines(self, tests, machines,
+ continuous_parsing=False):
"""Run each test in tests once using machines.
Instead of running each test on each machine like parallel_on_machines,
@@ -473,19 +474,21 @@ class base_server_job(base_job.base_job):
Args:
tests: List of tests to run.
- machines: list of machines to use.
+ machines: List of machines to use.
+ continuous_parsing: Bool, if true parse job while running.
"""
# The Queue is thread safe, but since a machine may have to search
# through the queue to find a valid test the lock provides exclusive
# queue access for more than just the get call.
- test_queue = Queue.Queue()
- test_queue_lock = threading.Lock()
+ test_queue = multiprocessing.JoinableQueue()
+ test_queue_lock = multiprocessing.Lock()
machine_workers = [server_job_utils.machine_worker(self,
machine,
self.resultdir,
test_queue,
- test_queue_lock)
+ test_queue_lock,
+ continuous_parsing)
for machine in machines]
# To (potentially) speed up searching for valid tests create a list of
« no previous file with comments | « no previous file | server/server_job_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698