Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -2451,32 +2451,16 @@ #f (lambda (dbdat db) (let* ((stmth (db:get-cache-stmth dbdat db qry))) (sqlite3:first-result stmth)))))) -;; NEW BEHAVIOR: Count tests running in only one run! -;; -(define (db:get-count-tests-actually-running dbstruct run-id) - (db:with-db - dbstruct - run-id - #f - (lambda (dbdat db) - (sqlite3:first-result - db - ;; WARNING BUG EDIT ME - merged from v1.55 - not sure what is right here ... - ;; "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id NOT IN (SELECT id FROM runs WHERE state='deleted') AND NOT (uname = 'n/a' AND item_path = '');") - "SELECT count(id) FROM tests WHERE state in ('RUNNING','REMOTEHOSTSTART','LAUNCHED') AND run_id=?;" - run-id)))) ;; NOT IN (SELECT id FROM runs WHERE state='deleted');") ;; NEW BEHAVIOR: Look only at single run with run-id ;; ;; (define (db:get-running-stats dbstruct run-id) (define (db:get-count-tests-running-for-run-id dbstruct run-id) ;; fastmode) - (let* ((qry ;; (if fastmode - ;; "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=? LIMIT 1;" - "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=?;")) ;; ) + (let* ((qry "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=?;")) (db:with-db dbstruct run-id #f (lambda (dbdat db) Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -1152,11 +1152,11 @@ (have-resources (and (if *journal-stats* (let* ((dbfname (conc (dbfile:run-id->dbnum run-id) ".db")) (load (tt:get-journal-stats dbfname))) - (if (> load 0.1) ;; dbs too busy to start more tests + (if (> load 0.05) ;; dbs too busy to start more tests (begin (debug:print-info 0 *default-log-port* "Gating launch due to db load "load" based on journal file observations for "dbfname) #f) #t)) (begin Index: tcp-transportmod.scm ================================================================== --- tcp-transportmod.scm +++ tcp-transportmod.scm @@ -640,21 +640,24 @@ (keep-srv (and good-ping same-host))) (if keep-srv (loop (cdr servrs) host (cons servdat result)) - (let* ((modtime (file-modification-time servinfofile))) + (let* ((modtime (handle-exceptions + exn + 9999 ;; file probably disappeared + (file-modification-time servinfofile)))) ;; if the .servinfo hasn't been touched in five min ;; we can be pretty sure the server is truly dead (if (> (- (current-seconds) modtime) 360) (handle-exceptions exn (debug:print-info 0 *default-log-port* "Error removing server info file: "servinfofile", " (condition->list exn)) - (delete-file* servinfofile)) - (loop (cdr servrs) prime-host result)))))) + (delete-file* servinfofile))) + (loop (cdr servrs) prime-host result))))) (else ;; can't delete it as we don't have a filename. NOTE: Should never get here. (debug:print-info 0 *default-log-port* "ERROR: bad servinfo record \""servdat"\"") (loop (cdr servrs) prime-host result)) ;; drop )))))