Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -205,13 +205,15 @@ (let ((key-string (conc (get-host-name) "-" (current-process-id)))) (with-output-to-file fname (lambda () (print key-string))) (thread-sleep! 0.25) - (with-input-from-file fname - (lambda () - (equal? key-string (read-line))))))) + (if (file-exists? fname) + (with-input-from-file fname + (lambda () + (equal? key-string (read-line)))) + #f)))) (define (common:simple-file-release-lock fname) (delete-file* fname)) ;;====================================================================== @@ -269,13 +271,13 @@ ;;====================================================================== (define (common:legacy-sync-recommended) (or (args:get-arg "-runtests") (args:get-arg "-server") - (args:get-arg "-set-run-status") + ;; (args:get-arg "-set-run-status") (args:get-arg "-remove-runs") - (args:get-arg "-get-run-status") + ;; (args:get-arg "-get-run-status") )) (define (common:legacy-sync-required) (configf:lookup *configdat* "setup" "megatest-db")) @@ -289,11 +291,12 @@ (if (and no-hurry (debug:debug-mode 18)) (rmt:print-db-stats)) (let ((th1 (make-thread (lambda () ;; thread for cleaning up, give it five seconds (let ((run-ids (hash-table-keys *db-local-sync*))) (if (and (not (null? run-ids)) - (configf:lookup *configdat* "setup" "megatest-db")) + (or (common:legacy-sync-recommended) + (configf:lookup *configdat* "setup" "megatest-db"))) (if no-hurry (db:multi-db-sync run-ids 'new2old)))) (if *dbstruct-db* (db:close-all *dbstruct-db*)) (if *inmemdb* (db:close-all *inmemdb*)) (if (and *megatest-db* (sqlite3:database? *megatest-db*)) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -775,11 +775,11 @@ ;; now ensure all newdb data are synced to megatest.db ;; do not use the run-ids list passed in to the function ;; (if (member 'new2old options) (let* ((maindb (make-dbr:dbstruct path: toppath local: #t)) - (src-run-ids (db:get-all-run-ids (db:dbdat-get-db (db:get-db maindb 0)))) + (src-run-ids (if run-ids run-ids (db:get-all-run-ids (db:dbdat-get-db (db:get-db maindb 0))))) (all-run-ids (sort (delete-duplicates (cons 0 src-run-ids)) <)) (count 1) (total (length all-run-ids)) (dead-runs '())) (for-each Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -341,12 +341,13 @@ (if (and legacy-sync (hash-table-ref/default *db-local-sync* run-id #f)) ;; (if (> (- start-time last-write) 5) ;; every five seconds (begin ;; let ((sync-time (- (current-seconds) start-time))) (db:multi-db-sync (list run-id) 'new2old) - (if (common:low-noise-print 30 "sync new to old") - (let ((sync-time (- (current-seconds) start-time))) + (let ((sync-time (- (current-seconds) start-time))) + (debug:print-info 3 "Sync of newdb to olddb for run-id " run-id " completed in " sync-time " seconds") + (if (common:low-noise-print 30 "sync new to old") (debug:print-info 0 "Sync of newdb to olddb for run-id " run-id " completed in " sync-time " seconds"))) ;; (if (> sync-time 10) ;; took more than ten seconds, start a server for this run ;; (begin ;; (debug:print-info 0 "Sync is taking a long time, start up a server to assist for run " run-id) ;; (server:kind-run run-id)))))