Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -2840,15 +2840,16 @@ (db:with-db dbstruct run-id #f (lambda (dbdat db) - (let ((res (cons #f #f))) + (let ((res (cons #f #f)) + (stmth (db:get-cache-stmth dbdat db "SELECT state,status FROM tests WHERE id=?;"))) (sqlite3:for-each-row ;; attemptnum added to hold pid of top process (not Megatest) controlling a test (lambda (state status) (cons state status)) - (db:get-cache-stmth dbdat db "SELECT state,status FROM tests WHERE id=?;") + stmth test-id) res)))) ;; Use db:test-get* to access ;; Get test data using test_ids. NB// Only works within a single run!! Index: dbfile.scm ================================================================== --- dbfile.scm +++ dbfile.scm @@ -1155,32 +1155,32 @@ ;; allowing request count to go up to 1000 and other crashes showed up: ;; Warning (#): in thread: (deserialize) unexpected end of input: # ;; ;; leave it fully on for now, test later if there is a performance issue ;; - (let* ((use-mutex #t) ;; (> *api-process-request-count* 25)) ;; risk of db corruption + (let* ((use-mutex #t) ;;(> *api-process-request-count* 50)) ;; risk of db corruption (have-struct (dbr:dbstruct? dbstruct)) - (dbdat (if have-struct ;; this stuff just allows us to call with a db handle directly - (db:open-db dbstruct run-id (dbfile:db-init-proc)) ;; (dbfile:get-subdb dbstruct run-id) - #f)) - (db (if have-struct ;; this stuff just allows us to call with a db handle directly - (dbr:dbdat-dbh dbdat) - dbstruct)) - (fname (if dbdat - (dbr:dbdat-dbfile dbdat) - "nofilenameavailable")) - (jfile (conc fname"-journal")) - (qryproc (lambda () - (if use-mutex (mutex-lock! *db-with-db-mutex*)) - (let ((res (apply proc dbdat db params))) ;; the actual call is here. - (if use-mutex (mutex-unlock! *db-with-db-mutex*)) - ;; (if (vector? dbstruct)(db:done-with dbstruct run-id r/w)) - (if dbdat - (dbfile:add-dbdat dbstruct run-id dbdat)) - ;; (delete-file* crumbfile) - res))) - (stop-train (conc (dbr:dbstruct-areapath dbstruct)"/stop-the-train"))) + (dbdat (if have-struct ;; this stuff just allows us to call with a db handle directly + (db:open-db dbstruct run-id (dbfile:db-init-proc)) ;; (dbfile:get-subdb dbstruct run-id) + #f)) + (db (if have-struct ;; this stuff just allows us to call with a db handle directly + (dbr:dbdat-dbh dbdat) + dbstruct)) + (fname (if dbdat + (dbr:dbdat-dbfile dbdat) + "nofilenameavailable")) + (jfile (conc fname"-journal")) + (qryproc (lambda () + (if use-mutex (mutex-lock! *db-with-db-mutex*)) + (let ((res (apply proc dbdat db params))) ;; the actual call is here. + (if use-mutex (mutex-unlock! *db-with-db-mutex*)) + ;; (if (vector? dbstruct)(db:done-with dbstruct run-id r/w)) + (if dbdat + (dbfile:add-dbdat dbstruct run-id dbdat)) + ;; (delete-file* crumbfile) + res))) + (stop-train (conc (dbr:dbstruct-areapath dbstruct)"/stop-the-train"))) (assert (sqlite3:database? db) "FATAL: db:with-db, db is not a database, db="db ", fname="fname) (if (file-exists? jfile) (begin Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -612,11 +612,11 @@ ;; this segment will run launch:setup only if -log is not set. This is fairly safe as servers are not ;; manually started and thus should never be started in a non-megatest area. Thus no need to handle situation ;; where (launch:setup) returns #f? ;; -(if (or (args:get-arg "-log")(args:get-arg "-server")) ;; redirect the log always when a server +(if (or (args:get-arg "-log")#;(args:get-arg "-server")) ;; redirect the log always when a server (handle-exceptions exn (begin (print "ERROR: Failed to switch to log output. " ((condition-property-accessor 'exn 'message) exn) ", exn=" exn)) (let* ((tl (or (args:get-arg "-log")(launch:setup))) ;; run launch:setup if -server, ensure we do NOT run launch:setup if -log specified Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -1862,11 +1862,12 @@ ;; (set! tal (cons newtestname tal)) ;; 4/6/2023 - try using cons, does it matter if the test gets added at the beginning? (set! incoming-tests (cons newtestname incoming-tests)) )) ;; since these are itemized create new test names testname/itempath items-in-testpatt))) - (if (< (length tal) 20) + (if (and (< (length tal) 20) + (not (null? incoming-tests))) (begin (set! tal (append tal (reverse incoming-tests))) (set! incoming-tests '()))) ;; At this point we have possibly added items to tal but all must be handed off to Index: tcp-transportmod.scm ================================================================== --- tcp-transportmod.scm +++ tcp-transportmod.scm @@ -600,11 +600,11 @@ (debug:print 0 *default-log-port* nrun" servers running on this host, not starting another.") (thread-sleep! 1)) (else (if (not (file-exists? (conc areapath"/logs"))) (create-directory (conc areapath"/logs") #t)) - (let* ((logfile (conc areapath "/logs/server.log")) ;; -" curr-pid "-" target-host ".log")) + (let* ((logfile (conc areapath "/logs/server-"dbfname"-"(current-process-id)".log")) ;; -" curr-pid "-" target-host ".log")) (cmdln (conc mtexe " -server - ";; (or target-host "-") " -m testsuite:" testsuite ;; " -run-id " (or run-id "main") ;; NO, we do NOT want to have run id as part of this