[LNT] r255969 - Don't time check workers!
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 17 18:10:08 PST 2015
Author: cmatthews
Date: Thu Dec 17 20:10:07 2015
New Revision: 255969
URL: http://llvm.org/viewvc/llvm-project?rev=255969&view=rev
Log:
Don't time check workers!
It makes too much logging traffic.
Modified:
lnt/trunk/lnt/server/ui/views.py
lnt/trunk/lnt/util/async_ops.py
Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=255969&r1=255968&r2=255969&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Thu Dec 17 20:10:07 2015
@@ -1173,7 +1173,7 @@ def rules():
@frontend.route('/log')
def log():
- async_ops.check_workers()
+ async_ops.check_workers(True)
note("Showing log page.")
return render_template("log.html")
@@ -1188,7 +1188,7 @@ def health():
return 500. Monitor might reboot us for this."""
explode = False
msg = "Ok"
- queue_length = async_ops.check_workers()
+ queue_length = async_ops.check_workers(False)
if queue_length > 10:
explode = True
msg = "Queue too long."
Modified: lnt/trunk/lnt/util/async_ops.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/util/async_ops.py?rev=255969&r1=255968&r2=255969&view=diff
==============================================================================
--- lnt/trunk/lnt/util/async_ops.py (original)
+++ lnt/trunk/lnt/util/async_ops.py Thu Dec 17 20:10:07 2015
@@ -45,27 +45,28 @@ def async_fieldchange_calc(ts, run):
ts,
func_args)
-def check_workers():
+def check_workers(is_logged):
global JOBS
JOBS = [x for x in JOBS if x.is_alive()]
still_running = len(JOBS)
msg = "{} Job(s) in the queue.".format(still_running)
- if still_running > 5:
- # This could be run outside of the application context, so use
- # full logger name.
- logging.getLogger("lnt.server.ui.app").warning(msg)
- elif still_running > 0:
- logging.getLogger("lnt.server.ui.app").info(msg)
- else:
- logging.getLogger("lnt.server.ui.app").info("Job queue empty.")
- #print [x for x in JOBS if not x.successful()]
+ if is_logged:
+ if still_running > 5:
+ # This could be run outside of the application context, so use
+ # full logger name.
+ logging.getLogger("lnt.server.ui.app").warning(msg)
+ elif still_running > 0:
+ logging.getLogger("lnt.server.ui.app").info(msg)
+ else:
+ logging.getLogger("lnt.server.ui.app").info("Job queue empty.")
+ return len(JOBS)
def async_run_job(job, ts, func_args):
"""Send a job to the async wrapper in the subprocess."""
# If the run is not in the database, we can't do anything more.
note("Queuing background job to process fieldchanges " + str(os.getpid()))
launch_workers()
- check_workers()
+ check_workers(True)
args = {'tsname': ts.name,
'db': g.db_name}
job = Process(target=async_wrapper,
More information about the llvm-commits
mailing list