Megatest

Diff
Login

Differences From Artifact [273888767b]:

To Artifact [c1fd4093ed]:


243
244
245
246
247
248
249


250
251
252
253
254
255
256
257
258

259

260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
      )
    )

  0)


;; TODO: for multiple areas, we will have multiple watchdogs; and multiple threads to manage


(set! *watchdog* (make-thread
		    (lambda ()
		      (handle-exceptions
			  exn
			  (begin
			    (print-call-chain)
			    (print " message: " ((condition-property-accessor 'exn 'message) exn) ", exn=" exn))
			(common:watchdog)))
		    "Watchdog thread"))



     ;;(if (not (args:get-arg "-server"))
     ;;    (thread-start! *watchdog*)) ;; if starting a server; wait till we get to running state before kicking off watchdog
     (let* ((no-watchdog-args
            '("-list-runs"
              "-testdata-csv"
              "-list-servers"
              "-server"
     	 "-adjutant"
              "-list-disks"
              "-list-targets"
              "-show-runconfig"
              ;;"-list-db-targets"
              "-show-runconfig"
              "-show-config"
              "-show-cmdinfo"
     	 "-cleanup-db"
                 ))
            (no-watchdog-argvals (list '("-archive" . "replicate-db")))
            (start-watchdog-specail-arg-val (let loop ((hed  (car no-watchdog-argvals))
                                                       (tail (cdr   no-watchdog-argvals)))
                                                  ;; (print "hed" hed " arg " (args:get-arg (car hed)) " val:" (cdr hed)  " eql" (equal? (args:get-arg (car hed)) (cdr hed)))  
                                                  (if (equal? (args:get-arg (car hed)) (cdr hed))
                                                    #f
                                                    (if (null? tail)
                                                      #t
                                                      (loop (car tail) (cdr tail))))))      
            (no-watchdog-args-vals (filter (lambda (x) x)
                                           (map args:get-arg no-watchdog-args)))
            (start-watchdog (and (null? no-watchdog-args-vals) start-watchdog-specail-arg-val)))
            ;(print  "no-watchdog-args="no-watchdog-args "no-watchdog-args-vals="no-watchdog-args-vals " start-watchdog-specail-arg-val:" start-watchdog-specail-arg-val " start-watchdog:" start-watchdog) 
       (if start-watchdog
           (thread-start! *watchdog*)))
     
;;======================================================================
;; TODO: for multiple areas, we will have multiple watchdogs; and multiple threads to manage
(define (common:watchdog)
  (debug:print-info 13 *default-log-port* "common:watchdog entered.")
  (if (launch:setup)
      (if (common:on-homehost?)







>
>
|
|
|
|
|
|
|
|
|
>

>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
      )
    )

  0)


;; TODO: for multiple areas, we will have multiple watchdogs; and multiple threads to manage
(define (init-watchdog)
  (set! (bdat-watchdog-set! *bdat*)
	(make-thread
	 (lambda ()
	   (handle-exceptions
	    exn
	    (begin
	      (print-call-chain)
	      (print " message: " ((condition-property-accessor 'exn 'message) exn) ", exn=" exn))
	    (common:watchdog)))
	 "Watchdog thread"))
  (start-watchdog))

(define (start-watchdog)
  ;;(if (not (args:get-arg "-server"))
  ;;    (thread-start! *watchdog*)) ;; if starting a server; wait till we get to running state before kicking off watchdog
  (let* ((no-watchdog-args
	  '("-list-runs"
	    "-testdata-csv"
	    "-list-servers"
	    "-server"
	    "-adjutant"
	    "-list-disks"
	    "-list-targets"
	    "-show-runconfig"
	    ;;"-list-db-targets"
	    "-show-runconfig"
	    "-show-config"
	    "-show-cmdinfo"
	    "-cleanup-db"
	    ))
	 (no-watchdog-argvals (list '("-archive" . "replicate-db")))
	 (start-watchdog-specail-arg-val (let loop ((hed  (car no-watchdog-argvals))
						    (tail (cdr   no-watchdog-argvals)))
					   ;; (print "hed" hed " arg " (args:get-arg (car hed)) " val:" (cdr hed)  " eql" (equal? (args:get-arg (car hed)) (cdr hed)))  
					   (if (equal? (args:get-arg (car hed)) (cdr hed))
					       #f
					       (if (null? tail)
						   #t
						   (loop (car tail) (cdr tail))))))      
	 (no-watchdog-args-vals (filter (lambda (x) x)
					(map args:get-arg no-watchdog-args)))
	 (start-watchdog (and (null? no-watchdog-args-vals) start-watchdog-specail-arg-val)))
					;(print  "no-watchdog-args="no-watchdog-args "no-watchdog-args-vals="no-watchdog-args-vals " start-watchdog-specail-arg-val:" start-watchdog-specail-arg-val " start-watchdog:" start-watchdog) 
    (if start-watchdog
	(thread-start! (bdat-watchdog *bdat*)))))
     
;;======================================================================
;; TODO: for multiple areas, we will have multiple watchdogs; and multiple threads to manage
(define (common:watchdog)
  (debug:print-info 13 *default-log-port* "common:watchdog entered.")
  (if (launch:setup)
      (if (common:on-homehost?)