@@ -52,19 +52,20 @@ (begin (thread-sleep! 1) (loop (file-exists? fullpath) (- count 1))) (begin + (debug:print 0 *default-log-port* "ERROR: removing the journal file " fullpath ", this is not good. Look for disk full, write access and other issues.") (if remove (system (conc "rm -rf " fullpath))) #f))) #t)))))) (define (tasks:get-task-db-path) (let ((dbdir (or (configf:lookup *configdat* "setup" "monitordir") (configf:lookup *configdat* "setup" "dbdir") (conc (configf:lookup *configdat* "setup" "linktree") "/.db")))) - (handle-exceptions + (common:debug-handle-exceptions #t exn (begin (debug:print-error 0 *default-log-port* "Couldn't create path to " dbdir) (exit 1)) (if (not (directory? dbdir))(create-directory dbdir #t))) @@ -80,11 +81,11 @@ ;; ==> open in-mem version ;; (define (tasks:open-db #!key (numretries 4)) (if *task-db* *task-db* - (handle-exceptions + (common:debug-handle-exceptions #t exn (if (> numretries 0) (begin (print-call-chain (current-error-port)) (debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn)) @@ -93,11 +94,11 @@ (tasks:open-db numretries (- numretries 1))) (begin (print-call-chain (current-error-port)) (debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn)) (debug:print 0 *default-log-port* " exn=" (condition->list exn)))) - (let* ((dbpath (tasks:get-task-db-path)) + (let* ((dbpath (db:dbfile-path )) ;; (tasks:get-task-db-path)) (dbfile (conc dbpath "/monitor.db")) (avail (tasks:wait-on-journal dbpath 10)) ;; wait up to about 10 seconds for the journal to go away (exists (file-exists? dbpath)) (write-access (file-write-access? dbpath)) (mdb (cond ;; what the hek is *toppath* doing here? @@ -468,11 +469,11 @@ (define (tasks:param-key->id dbstruct task-params) (db:with-db dbstruct #f #f (lambda (db) - (handle-exceptions + (common:debug-handle-exceptions #t exn #f (sqlite3:first-result db "SELECT id FROM tasks_queue WHERE params LIKE ?;" task-params))))) @@ -484,19 +485,19 @@ (define (tasks:get-records-given-param-key dbstruct param-key state-patt action-patt test-patt) (db:with-db dbstruct #f #f (lambda (db) - (handle-exceptions + (common:debug-handle-exceptions #t exn '() (sqlite3:first-row db "SELECT id,action,owner,state,target,name,testpatt,keylock,params WHERE params LIKE ? AND state LIKE ? AND action LIKE ? AND testpatt LIKE ?;" param-key state-patt action-patt test-patt))))) (define (tasks:find-task-queue-records dbstruct target run-name test-patt state-patt action-patt) - ;; (handle-exceptions + ;; (common:debug-handle-exceptions #t ;; exn ;; '() ;; (sqlite3:first-row (let ((db (db:delay-if-busy (db:get-db dbstruct))) (res '())) @@ -528,11 +529,11 @@ (pid (string->number (caddr match-dat)))) (debug:print 0 *default-log-port* "Sending SIGINT to process " pid " on host " hostname) (if (equal? (get-host-name) hostname) (if (process:alive? pid) (begin - (handle-exceptions + (common:debug-handle-exceptions #t exn (begin (debug:print 0 *default-log-port* "Kill of process " pid " on host " hostname " failed.") (debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn)) #t) @@ -593,11 +594,11 @@ ;; (define (tasks:set-area dbh configdat #!key (toppath #f)) ;; could I safely put *toppath* in for the default for toppath? when would it be evaluated? (let loop ((area-name (or (configf:lookup configdat "setup" "area-name") (common:get-area-name))) (modifier 'none)) - (let ((success (handle-exceptions + (let ((success (common:debug-handle-exceptions #t exn (begin (debug:print 0 *default-log-port* "ERROR: cannot create area entry, " ((condition-property-accessor 'exn 'message) exn)) #f) ;; FIXME: I don't care for now but I should look at *why* there was an exception (pgdb:add-area dbh area-name (or toppath *toppath*))))) @@ -639,11 +640,11 @@ (pgdb:refresh-run-info dbh new-run-id state status owner event-time comment fail-count pass-count) new-run-id) - (if (handle-exceptions + (if (common:debug-handle-exceptions #t exn (begin (print-call-chain) #f) (pgdb:insert-run dbh spec-id target run-name state status owner event-time comment fail-count pass-count)) ;; area-id))