Index: dbmod.scm ================================================================== --- dbmod.scm +++ dbmod.scm @@ -30,10 +30,11 @@ (module dbmod ( ;; for debug, can be commented out in production dbmod:safely-open-db dbmod:with-db + dbmod:open-db ;; used elsewhere, keep dbmod:db-to-db-sync db:test-get-event_time @@ -298,11 +299,11 @@ ;; MOVE THIS CALL TO INSIDE THE sync-proc CALL (dbr:dbstruct-last-update-set! dbstruct curr-secs) ))) (assert (sqlite3:database? dbh) "FATAL: bad db handle in dbmod:with-db") - (if use-mutex (mutex-lock! *db-with-db-mutex*)) + ;; (if use-mutex (mutex-lock! *db-with-db-mutex*)) ;; this mutex was causing deadlock. Found in fullrun test. (let* ((res (let loop ((count 10)) (condition-case (apply proc dbdat dbh params) (exn (sqlite3) ;; was 'busy', but never got hit (if (> count 0) @@ -318,11 +319,11 @@ ((condition-property-accessor 'exn 'message) exn))) (exn () (dbfile:print-err exn "ERROR: dbmod:with-db: Unknown error with database for run-id "run-id", params "params", message: " ((condition-property-accessor 'exn 'message) exn)) (exit 2)))))) - (if use-mutex (mutex-unlock! *db-with-db-mutex*)) + ;; (if use-mutex (mutex-unlock! *db-with-db-mutex*)) res))) (define (db:with-db dbstruct run-id w/r proc . params) (dbmod:with-db dbstruct run-id w/r proc params))