Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -252,11 +252,11 @@ (define *common:this-exe-dir* (pathname-directory *common:this-exe-fullpath*)) (define *common:this-exe-name* (pathname-strip-directory *common:this-exe-fullpath*)) (define (common:get-sync-lock-filepath) (let* ((tmp-area (common:get-db-tmp-area)) - (lockfile (conc tmp-area "/megatest.db.sync-lock"))) + (lockfile (conc tmp-area "/megatest.db.lock"))) lockfile)) (define *common:logpro-exit-code->status-sym-alist* '( ( 0 . pass ) ( 1 . fail ) Index: dashboard-transport-mode.scm.template ================================================================== --- dashboard-transport-mode.scm.template +++ dashboard-transport-mode.scm.template @@ -13,10 +13,10 @@ ;; (dbfile:sync-method 'none) ;; (dbfile:cache-method 'none) ;; (rmt:transport-mode 'nfs) ;; uncomment this block to test with tcp and cachedb -(dbfile:sync-method 'original) +(dbfile:sync-method 'none) ;; original was causing crash on start. (dbfile:cache-method 'none) (rmt:transport-mode 'nfs) Index: dbmod.scm ================================================================== --- dbmod.scm +++ dbmod.scm @@ -153,14 +153,16 @@ (define (dbmod:safely-open-db dbfullname init-proc write-access) (dbfile:with-simple-file-lock (conc dbfullname".lock") (lambda () - (let* ((db (sqlite3:open-database dbfullname)) - (handler (sqlite3:make-busy-timeout 136000))) + (let* ((dbexists (file-exists? dbfullname)) + (db (sqlite3:open-database dbfullname)) + (handler (sqlite3:make-busy-timeout 136000))) (sqlite3:set-busy-handler! db handler) - (if write-access + (if (and dbexists + write-access) (init-proc db)) db)))) (define *sync-in-progress* #f) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -2581,24 +2581,30 @@ (if (and src-db dest-db) (if (file-exists? src-db) (if (file-exists? lockfile) (debug:print 0 *default-log-port* "Lock "lockfile" exists, skipping sync...") - (begin - (with-output-to-file lockfile - (lambda () - (print (current-process-id)))) - (debug:print-info 0 *default-log-port* "Attempting to sync data from "src-db" to "dest-db"...") - (if (not (file-exists? dest-db)) - (begin - (debug:print 0 *default-log-port* "Using copy to create "dest-db" from "src-db) - (file-copy src-db dest-db)) - (let ((res (dbmod:db-to-db-sync src-db dest-db 0 (dbfile:db-init-proc) keys))) - (if res - (debug:print-info 0 *default-log-port* "Synced " res " records from "src-db" to "dest-db) - (debug:print-info 0 *default-log-port* "No sync due to permissions or other issue.")))) - (delete-file* lockfile))) + (dbfile:with-simple-file-lock + lockfile + (lambda () + ;;(with-output-to-file lockfile + ;; (lambda () + ;; (print (current-process-id)))) + (debug:print-info 0 *default-log-port* "Attempting to sync data from "src-db" to "dest-db"...") + (if #f ;; (not (file-exists? dest-db)) + (begin + (dbfile:with-simple-file-lock + (conc dest-db ".lock") ;; is the db being opened right now? + (lambda () + (debug:print 0 *default-log-port* "Using copy to create "dest-db" from "src-db) + (file-copy src-db dest-db)))) + (let ((res (dbmod:db-to-db-sync src-db dest-db 0 (dbfile:db-init-proc) keys))) + (if res + (debug:print-info 0 *default-log-port* "Synced " res " records from "src-db" to "dest-db) + (debug:print-info 0 *default-log-port* "No sync due to permissions or other issue.")))) + ;; (delete-file* lockfile) + ))) (debug:print 0 *default-log-port* "No sync due to unreadble or non-existant source file"src-db)) (debug:print 0 *default-log-port* "Usage for -db2db; -to and -from must be specified")) (set! *didsomething* #t))) (if (args:get-arg "-list-test-time") Index: tcp-transportmod.scm ================================================================== --- tcp-transportmod.scm +++ tcp-transportmod.scm @@ -795,11 +795,11 @@ (let* ((errdat (condition->list exn))) (set! exn-result errdat) (debug:print 0 *default-log-port* "ERROR: handler exception, these are bad, will exit in five seconds.") (pp errdat *default-log-port*) ;; these are always bad, set up an exit thread - #;(thread-start! (make-thread (lambda () + (thread-start! (make-thread (lambda () (thread-sleep! 5) (exit)))) #f) (handler indat) ;; this is the proc being called by the remote client )))