Megatest

Check-in [19f6ae918c]
Login
Overview
Comment:Treat any exceptions when logging into server as a dead server (for now)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.60
Files: files | file ages | folders
SHA1: 19f6ae918cb69f180051e9e2cc5040c284245d4b
User & Date: mrwellan on 2014-12-09 10:27:37
Other Links: branch diff | manifest | tags
Context
2014-12-10
08:05
Cherrypicked nodes f0a3 and 1b36 into v1.60 check-in: 9f5898d48f user: mrwellan tags: v1.60
2014-12-09
21:00
Hand-merged refactor of server launch/client start code check-in: e7355f3724 user: matt tags: v1.60-broken-test1
10:51
Removing mark-incomplete from runs queue processing check-in: 76ef9fc5ad user: mrwellan tags: temp-hacks
10:27
Treat any exceptions when logging into server as a dead server (for now) check-in: 19f6ae918c user: mrwellan tags: v1.60
09:38
Allow some retries on run queue processing if server died (temporary work-around until the recovery is coded correctly) check-in: 187be74df3 user: mrwellan tags: v1.60
Changes

Modified client.scm from [134437c4d3] to [a61d4e6d81].

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64






65
66
67
68
69
70
71
46
47
48
49
50
51
52






53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71







-
-
-
-
-
-






+
+
+
+
+
+







(define (client:connect iface port)
  (case (server:get-transport)
    ((rpc)  (rpc:client-connect  iface port))
    ((http) (http:client-connect iface port))
    ((zmq)  (zmq:client-connect  iface port))
    (else   (rpc:client-connect  iface port))))

(define (client:login-no-auto-setup server-info run-id)
  (case (server:get-transport)
    ((rpc)  (rpc:login-no-auto-client-setup server-info run-id))
    ((http) (rmt:login-no-auto-client-setup server-info run-id))
    (else   (rpc:login-no-auto-client-setup server-info run-id))))

(define (client:setup  run-id #!key (remaining-tries 10) (failed-connects 0))
  (case (server:get-transport)
    ((rpc) (rpc-transport:client-setup run-id)) ;;(client:setup-rpc run-id))
    ((http)(client:setup-http run-id))
    (else  (rpc-transport:client-setup run-id)))) ;; (client:setup-rpc run-id))))

;; (define (client:login-no-auto-setup server-info run-id)
;;   (case (server:get-transport)
;;     ((rpc)  (rpc:login-no-auto-client-setup server-info run-id))
;;     ((http) (rmt:login-no-auto-client-setup server-info run-id))
;;     (else   (rpc:login-no-auto-client-setup server-info run-id))))
;; 
;; (define (client:setup-rpc run-id)
;;   (debug:print 0 "INFO: client:setup remaining-tries=" remaining-tries)
;;   (if (<= remaining-tries 0)
;;       (begin
;; 	(debug:print 0 "ERROR: failed to start or connect to server for run-id " run-id)
;; 	(exit 1))
;;       (let ((host-info (hash-table-ref/default *runremote* run-id #f)))

Modified rmt.scm from [434920ac36] to [c2992f6eb2].

99
100
101
102
103
104
105
106


107
108
109
110
111
112
113
99
100
101
102
103
104
105

106
107
108
109
110
111
112
113
114







-
+
+







	 (connection-info (rmt:get-connection-info run-id)))
    ;; the nmsg method does the encoding under the hood (the http method should be changed to do this also)
    (if connection-info
	;; use the server if have connection info
	(let* ((dat     (case *transport-type*
			  ((http)(condition-case
				  (http-transport:client-api-send-receive run-id connection-info cmd params)
				  ((commfail)(vector #f "communications fail"))))
				  ((commfail)(vector #f "communications fail"))
				  ((exn)(vector #f "other fail"))))
			  ((nmsg)(condition-case
				  (nmsg-transport:client-api-send-receive run-id connection-info cmd params)
				  ((timeout)(vector #f "timeout talking to server"))))
			  (else  (exit))))
	       (success (if (vector? dat) (vector-ref dat 0) #f))
	       (res     (if (vector? dat) (vector-ref dat 1) #f)))
	  (if (vector? connection-info)(http-transport:server-dat-update-last-access connection-info))
232
233
234
235
236
237
238
239
240
241





242
243
244
245
246
247
248
233
234
235
236
237
238
239



240
241
242
243
244
245
246
247
248
249
250
251







-
-
-
+
+
+
+
+







	    (hash-table-set! *db-local-sync* (or run-id 0) start-time) ;; the oldest "write"
	    (mutex-unlock! *db-multi-sync-mutex*)))
      res)))

(define (rmt:send-receive-no-auto-client-setup connection-info cmd run-id params)
  (let* ((run-id   (if run-id run-id 0))
	 ;; (jparams  (db:obj->string params)) ;; (rmt:dat->json-str params))
	 (res  	   (condition-case
		    (http-transport:client-api-send-receive run-id connection-info cmd params)
		    ((commfail) #f)))) ;; (vector #f "communications fail")))))
	 (res  	   (handle-exceptions
		    exn
		    #f
		    (http-transport:client-api-send-receive run-id connection-info cmd params))))
;;		    ((commfail) (vector #f "communications fail")))))
    (if (and res (vector-ref res 0))
	res
	#f)))
;; 	(db:string->obj (vector-ref dat 1))
;; 	(begin
;; 	  (debug:print 0 "ERROR: rmt:send-receive-no-auto-client-setup failed, attempting to continue. Got " dat)
;; 	  dat))))

Modified runs.scm from [fb0ddf9858] to [866c85daf6].

384
385
386
387
388
389
390



391

392
393
394
395
396
397
398
384
385
386
387
388
389
390
391
392
393

394
395
396
397
398
399
400
401







+
+
+
-
+







					     (runs:run-tests-queue run-id runname test-records keyvals flags test-patts required-tests (any->number reglen) all-tests-registry)))
					  "runs:run-tests-queue"))
		 (th2        (make-thread (lambda ()				    
					    ;; (rmt:find-and-mark-incomplete-all-runs))))) CAN'T INTERRUPT IT ...
					    (let ((run-ids (rmt:get-all-run-ids)))
					      (for-each (lambda (run-id)
							  (if keep-going
							      (handle-exceptions
							       exn
							       (debug:print 0 "error in calling find-and-mark-incomplete for run-id " run-id)
							      (rmt:find-and-mark-incomplete run-id #f))) ;; ovr-deadtime)))
							       (rmt:find-and-mark-incomplete run-id #f)))) ;; ovr-deadtime)))
							run-ids)))
					  "runs: mark-incompletes")))
	    (thread-start! th1)
	    (thread-start! th2)
	    (thread-join! th1)
	    (set! keep-going #f)
	    (thread-join! th2)