Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -46,11 +46,11 @@ (define *test-meta-updated* (make-hash-table)) (define *globalexitstatus* 0) ;; attempt to work around possible thread issues (define *passnum* 0) ;; when running track calls to run-tests or similar (define *write-frequency* (make-hash-table)) ;; run-id => (vector (current-seconds) 0)) (define *alt-log-file* #f) ;; used by -log - +(define *db-sync-mutex* (make-mutex)) ;; DATABASE (define *open-dbs* (vector #f (make-hash-table))) ;; megatestdb run-id-dbs ;; SERVER Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -373,10 +373,11 @@ '("tags" #f) '("jobgroup" #f))))) ;; tbls is ( ("tablename" ( "field1" [#f|proc1] ) ( "field2" [#f|proc2] ) .... ) ) (define (db:sync-tables tbls fromdb todb . slave-dbs) + (mutex-lock! *db-sync-mutex*) (cond ((not fromdb) (debug:print 3 "WARNING: db:sync-tables called with fromdb missing") -1) ((not todb) (debug:print 3 "WARNING: db:sync-tables called with todb missing") -2) ((not (sqlite3:database? fromdb)) (debug:print 0 "ERROR: db:sync-tables called with fromdb not a database " fromdb) -3) @@ -461,11 +462,12 @@ (count (cdr dat))) (set! tot-count (+ tot-count count)) (if (> count 0) (debug:print 0 (format #f " ~10a ~5a" tblname count))))) (sort (hash-table->alist numrecs)(lambda (a b)(> (cdr a)(cdr b)))))) - tot-count)))) + tot-count))) + (mutex-unlock! *db-sync-mutex*)) ;; keeping it around for debugging purposes only (define (open-run-close-no-exception-handling proc idb . params) (debug:print-info 11 "open-run-close-no-exception-handling START given a db=" (if idb "yes " "no ") ", params=" params) (if (or *db-write-access* @@ -2237,11 +2239,11 @@ ;; M I S C M A N A G E M E N T I T E M S ;;====================================================================== ;; A routine to map itempaths using a itemmap (define (db:compare-itempaths patha pathb itemmap) - (debug:print-info 3 "ITEMMAP is " itemmap) + (debug:print-info 6 "ITEMMAP is " itemmap) (if itemmap (let* ((mapparts (string-split itemmap)) (pattern (car mapparts)) (replacement (if (> (length mapparts) 1) (cadr mapparts) ""))) (if replacement