@@ -1534,11 +1534,11 @@ state TEXT DEFAULT 'new', status TEXT DEFAULT 'n/a', archive_type TEXT DEFAULT 'bup', du INTEGER, archive_path TEXT);"))) - (print "creating trigges from init") + ;; (print "creating trigges from init") (db:create-triggers db) db)) ;; ) ;;====================================================================== ;; A R C H I V E S @@ -4017,32 +4017,35 @@ (begin ;; is there a rollup lock? If not, take it (sqlite3:with-transaction no-sync-db (lambda () - (let* ((rollup-lock-time (db:no-sync-get/default no-sync-db rollup-lock-key #f)) - (waiting-lock-time (db:no-sync-get/default no-sync-db waiting-lock-key #f))) - (if rollup-lock-time ;; someone is doing a rollup - (if (not waiting-lock-time) ;; no one is waiting - (begin - (set! wait-flag #t) - (set! rollup-flag #t) - (db:no-sync-set no-sync-db waiting-lock-key (current-seconds)))) ;; we are going to wait - (begin - (set! rollup-flag #t) - (db:no-sync-set no-sync-db rollup-lock-key (current-seconds))))))) - (if wait-flag - (let loop ((count 100)) - (thread-sleep! 2) - (if (and (not (db:no-sync-get/default no-sync-db waiting-lock-key #f)) - (> count 0)) - (loop (+ count 1)) - (sqlite3:with-transaction - no-sync-db - (lambda () - (db:no-sync-set no-sync-db rollup-lock-key (current-seconds)) - (db:no-sync-del! no-sync-db waiting-lock-key)))))) + (handle-exceptions + exn + (debug:print 0 *default-log-port* "EXCEPTION: exn="exn) + (let* ((rollup-lock-time (db:no-sync-get/default no-sync-db rollup-lock-key #f)) + (waiting-lock-time (db:no-sync-get/default no-sync-db waiting-lock-key #f))) + (if rollup-lock-time ;; someone is doing a rollup + (if (not waiting-lock-time) ;; no one is waiting + (begin + (set! wait-flag #t) + (set! rollup-flag #t) + (db:no-sync-set no-sync-db waiting-lock-key (current-seconds)))) ;; we are going to wait + (begin + (set! rollup-flag #t) + (db:no-sync-set no-sync-db rollup-lock-key (current-seconds))))))) + (if wait-flag + (let loop ((count 100)) + (thread-sleep! 2) + (if (and (not (db:no-sync-get/default no-sync-db waiting-lock-key #f)) + (> count 0)) + (loop (+ count 1)) + (sqlite3:with-transaction + no-sync-db + (lambda () + (db:no-sync-set no-sync-db rollup-lock-key (current-seconds)) + (db:no-sync-del! no-sync-db waiting-lock-key))))))) ;; now the rollup (if rollup-flag ;; put this into a thread (thread-start! (make-thread (lambda () (db:roll-up-test-state-status dbstruct run-id test-name state status) @@ -4471,18 +4474,19 @@ set-verbosity killserver )) (define (db:login dbstruct calling-path calling-version client-signature) - (cond + (cond ((not (equal? calling-path *toppath*)) (list #f "Login failed due to mismatch paths: " calling-path ", " *toppath*)) ;; ((not (equal? *run-id* run-id)) ;; (list #f "Login failed due to mismatch run-id: " run-id ", " *run-id*)) ((not (equal? megatest-version calling-version)) (list #t (conc "Login warning due to mismatch megatest version: " calling-version ", " megatest-version))) - (else + + (else (hash-table-set! *logged-in-clients* client-signature (current-seconds)) '(#t "successful login")))) (define (db:general-call dbstruct stmtname params) (let ((query (let ((q (alist-ref (if (string? stmtname)