Megatest

Diff
Login

Differences From Artifact [d0aaf6cd91]:

To Artifact [d8fa815575]:


92
93
94
95
96
97
98
99
100




101
102
103
104
105

106
107
108
109
110
111
112
92
93
94
95
96
97
98


99
100
101
102
103
104
105
106

107
108
109
110
111
112
113
114







-
-
+
+
+
+




-
+







(define (rmt:send-receive cmd run-id params #!key (attemptnum 1)(ttdat #f))
  (assert (or (not run-id) (number? run-id)) "FATAL: run-id is required to be a number or #f")
  (assert *toppath* "FATAL: rmt:send-receive called with *toppath* not set.")
  (let* ((areapath      *toppath*) ;; TODO - resolve from dbstruct to be compatible with multiple areas
	 (readonly-mode (rmtmod:calc-ro-mode ttdat *toppath*))
	 (testsuite     (common:get-testsuite-name))
	 (dbfname       (conc (dbfile:run-id->dbnum run-id)".db"))
	 (dbdir         (conc areapath "/.mtdb")))
    (if (and (not *journal-stats*)
	 (dbdir         (conc areapath "/.mtdb"))
         (journal-check #f)) ;; disabling journal check for now, since journal files are only possible on the NFS dbs.

    (if (and journal-check (not *journal-stats*)
	     (file-exists? dbdir))
	(tt:start-stats dbdir)) ;; fixme - find the right call to get the db directory
    
    ;; check the load on dbfname and add some delay using a droop curve of sorts
    (if *journal-stats*
    (if (and journal-check *journal-stats*)
	(let* ((load  (tt:get-journal-stats dbfname)))
	  (if (> load 0.1) ;; start activating delay at 10% journal load time
	      (let ((dely (* 50 (* load load)))) ;; 100% journal time=50sec delay
		(debug:print 0 *default-log-port* "Journal load "load" on "dbfname" delaying queries "dely"s.")
		(thread-sleep! dely)))))
	
    (case (rmt:transport-mode)