Megatest

Check-in [ffccd73793]
Login
Overview
Comment:wip
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.6584-ck5
Files: files | file ages | folders
SHA1: ffccd73793a9fe6384f8174759f66ae051837038
User & Date: matt on 2021-05-20 20:33:56
Other Links: branch diff | manifest | tags
Context
2021-05-20
21:23
wip check-in: 3576b029da user: matt tags: v1.6584-ck5
20:33
wip check-in: ffccd73793 user: matt tags: v1.6584-ck5
05:41
wip check-in: db05dadd93 user: matt tags: v1.6584-ck5
Changes

Modified launchmod.scm from [c2309e8637] to [6c7ea9f92b].

2361
2362
2363
2364
2365
2366
2367


2368



2369
2370
2371
2372
2373
2374
2375
		      (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







>
>
|
>
>
>







2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
		      (make-thread
		       (lambda ()
			 (handle-exceptions
			  exn
			  (begin
			    (print-call-chain)
			    (print " message: " ((condition-property-accessor 'exn 'message) exn) ", exn=" exn))
			  (let loop ()
			    (if *toppath*
				(common:watchdog)
				(begin
				  (thread-sleep! 1)
				  (loop))))))
		       "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

Modified rmtmod.scm from [c678d93a8b] to [2a788fb0b5].

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
;;
(define (rmt:general-open-connection remote apath dbname #!key (num-tries 5))
  (let  ((mainconn (rmt:get-connection remote apath (db:run-id->dbname #f))))
    ;; (debug:print 0 *default-log-port* "remote: " remote)
    (if (not mainconn)
	(begin
	  (rmt:open-main-connection remote apath)
	  (thread-sleep! 1)
	  (rmt:general-open-connection remote apath dbname))
	;; we have a connection to main, ask for contact info for dbname
	(let* ((res (rmt:send-receive 'get-server #f `(,apath ,dbname))))
	  (case res
	    ((server-started)
	     (if (> num-tries 0)
		 (begin
		   (thread-sleep! 2)
		   (rmt:general-open-connection remote apath dbname num-tries: (- num-tries 1)))

		 'failed))
	    
	    (else

	     res))))))

;;======================================================================

;; Defaults to current area
;;
(define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f))







|


|





|
>



>







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
;;
(define (rmt:general-open-connection remote apath dbname #!key (num-tries 5))
  (let  ((mainconn (rmt:get-connection remote apath (db:run-id->dbname #f))))
    ;; (debug:print 0 *default-log-port* "remote: " remote)
    (if (not mainconn)
	(begin
	  (rmt:open-main-connection remote apath)
	  (thread-sleep! 2)
	  (rmt:general-open-connection remote apath dbname))
	;; we have a connection to main, ask for contact info for dbname
	(let* ((res (rmt:send-receive-real remote apath dbname 'get-server #f `(,apath ,dbname))))
	  (case res
	    ((server-started)
	     (if (> num-tries 0)
		 (begin
		   (thread-sleep! 2)
		   (rmt:general-open-connection remote apath dbname
						num-tries: (- num-tries 1)))
		 'failed))
	    
	    (else
	     (debug:print-info 0 *default-log-port* "Unexpected result: " res)
	     res))))))

;;======================================================================

;; Defaults to current area
;;
(define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f))

Modified tests/unittests/basicserver.scm from [35151728ed] to [1f95013738].

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

(import rmtmod trace http-client apimod dbmod
	launchmod)
(trace-call-sites #t)
(trace
 ;; db:get-dbdat
 ;; rmt:find-main-server
 rmt:send-receive-real
 rmt:send-receive
 ;; sexpr->string
;; server-ready?
;; rmt:register-server
;; rmt:open-main-connection
 rmt:general-open-connection
 rmt:get-connection
 common:watchdog
;; rmt:find-main-server
;; get-all-server-pkts
;; get-viable-servers
;; get-best-candidate
 ;; api:run-server-process
 )

(test #f #t (rmt:remote? (let ((r (make-rmt:remote)))
			   (set! *rmt:remote* r)
			   r)))
(test #f #f (rmt:get-connection *rmt:remote* *toppath* ".db/main.db"))







|
|

|
|
|
|
|
|
|
|
|
|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

(import rmtmod trace http-client apimod dbmod
	launchmod)
(trace-call-sites #t)
(trace
 ;; db:get-dbdat
 ;; rmt:find-main-server
 ;; rmt:send-receive-real
 ;; rmt:send-receive
 ;; sexpr->string
 ;; server-ready?
 ;; rmt:register-server
 ;; rmt:open-main-connection
 ;; rmt:general-open-connection
 ;; rmt:get-connection
 ;; common:watchdog
 ;; rmt:find-main-server
 ;; get-all-server-pkts
 ;; get-viable-servers
 ;; get-best-candidate
 ;; api:run-server-process
 )

(test #f #t (rmt:remote? (let ((r (make-rmt:remote)))
			   (set! *rmt:remote* r)
			   r)))
(test #f #f (rmt:get-connection *rmt:remote* *toppath* ".db/main.db"))