Index: rmt.scm ================================================================== --- rmt.scm +++ rmt.scm @@ -101,22 +101,29 @@ ;; start with three calls then kill server (if (eq? attemptnum 3)(tasks:kill-server-run-id run-id)) (rmt:send-receive cmd run-id params attemptnum: (+ attemptnum 1))))) (let ((max-avg-qry (string->number (or (configf:lookup *configdat* "server" "server-query-threshold") "10")))) - (debug:print-info 4 "no server and read-only query, bypassing normal channel") - ;; (if (rmt:write-frequency-over-limit? cmd run-id)(server:kind-run run-id)) - (let* ((curr-max (rmt:get-max-query-average run-id)) - (curr-max-val (cdr curr-max))) - (if (> curr-max-val max-avg-qry) - (if (common:low-noise-print 10 "start server due to max average query too long") - (begin - (debug:print-info 0 "Max average query, " (inexact->exact (round curr-max-val)) "ms (" (car curr-max) ") exceeds " max-avg-qry "ms, try starting server ...") - (server:kind-run run-id)) - (debug:print-info 3 "Max average query, " (inexact->exact (round curr-max-val)) "ms (" (car curr-max) ") below " max-avg-qry "ms, not starting server...")))) - (rmt:open-qry-close-locally cmd run-id params))))) - + (if (and (< attemptnum 10) + (configf:lookup *configdat* "server" "required")) + (begin + (debug:print-info 0 "Server required mode, attempting to start server and retry query in ten seconds") + (server:kind-run run-id) + (thread-sleep! 10) + (rmt:send-receive cmd rid params (+ attemptnum 1))) + ;; (if (rmt:write-frequency-over-limit? cmd run-id)(server:kind-run run-id)) + (let* ((curr-max (rmt:get-max-query-average run-id)) + (curr-max-val (cdr curr-max))) + (debug:print-info 4 "no server and read-only query, bypassing normal channel") + (if (> curr-max-val max-avg-qry) + (if (common:low-noise-print 10 "start server due to max average query too long") + (begin + (debug:print-info 0 "Max average query, " (inexact->exact (round curr-max-val)) "ms (" (car curr-max) ") exceeds " max-avg-qry "ms, try starting server ...") + (server:kind-run run-id)) + (debug:print-info 3 "Max average query, " (inexact->exact (round curr-max-val)) "ms (" (car curr-max) ") below " max-avg-qry "ms, not starting server..."))) + (rmt:open-qry-close-locally cmd run-id params))))))) + (define (rmt:update-db-stats run-id rawcmd params duration) (mutex-lock! *db-stats-mutex*) (handle-exceptions exn (begin Index: tests/fullrun/megatest.config ================================================================== --- tests/fullrun/megatest.config +++ tests/fullrun/megatest.config @@ -133,10 +133,13 @@ # This server will keep running this number of hours after last access. # Three minutes is 0.05 hours # timeout 0.025 timeout 0.01 + +# Server is required - slower but more resistant to Sqlite issues. +required yes # daemonize yes # hostname #{scheme (get-host-name)} ## disks are: