Megatest

Check-in [2c6622a2b7]
Login
Overview
Comment:Improved recovery when communications goes bad in http transport
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.60
Files: files | file ages | folders
SHA1: 2c6622a2b742bfcd4a2a7be929b2b12eda9b60dc
User & Date: matt on 2015-03-30 22:49:51
Other Links: branch diff | manifest | tags
References
2015-04-01
22:11 Fixed ticket [ec89f803f2]: http-client error when server is dead plus 5 other changes artifact: e462c888fb user: matt
21:54 Fixed ticket [d33ba94e7e]: Communication to server failing with message: WARNING: Communication failed, trying call to http-transport:client-api-send-receive again. plus 5 other changes artifact: 23c1326599 user: matt
Context
2015-03-31
08:24
Added makefile to batchsim check-in: 37efe35171 user: mrwellan tags: v1.60
2015-03-30
22:49
Improved recovery when communications goes bad in http transport check-in: 2c6622a2b7 user: matt tags: v1.60
2015-03-27
11:22
Cleaned up batchsim check-in: 47f6163e4c user: mrwellan tags: v1.60
Changes

Modified http-transport.scm from [c3c2fc0fe7] to [e2a8a6ff8e].

270
271
272
273
274
275
276
277
278
279
280
281

282
283
284
285
286
287
288
					   exn
					   (begin
					     (set! success #f)
					     (debug:print 0 "WARNING: failure in with-input-from-request to " fullurl ".")
					     (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn))
					     (hash-table-delete! *runremote* run-id)
					     ;; Killing associated server to allow clean retry.")
					     (tasks:kill-server-run-id run-id)  ;; better to kill the server in the logic that called this routine?
					     (mutex-unlock! *http-mutex*)
					     (signal (make-composite-condition
						      (make-property-condition 'commfail 'message "failed to connect to server")))
					     "communications failed")

					   (with-input-from-request ;; was dat
					    fullurl 
					    (list (cons 'key "thekey")
						  (cons 'cmd cmd)
						  (cons 'params sparams))
					    read-string))
					  transport: 'http)))







|

|
|
|
>







270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
					   exn
					   (begin
					     (set! success #f)
					     (debug:print 0 "WARNING: failure in with-input-from-request to " fullurl ".")
					     (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn))
					     (hash-table-delete! *runremote* run-id)
					     ;; Killing associated server to allow clean retry.")
					     ;; (tasks:kill-server-run-id run-id)  ;; better to kill the server in the logic that called this routine?
					     (mutex-unlock! *http-mutex*)
					     ;;; (signal (make-composite-condition
					     ;;;          (make-property-condition 'commfail 'message "failed to connect to server")))
					     ;;; "communications failed"
					     (db:obj->string #f))
					   (with-input-from-request ;; was dat
					    fullurl 
					    (list (cons 'key "thekey")
						  (cons 'cmd cmd)
						  (cons 'params sparams))
					    read-string))
					  transport: 'http)))

Modified tests/unittests/basicserver.scm from [28418079ab] to [f2f7d0aa9d].

137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
    (thread-sleep! 1)
    (case test-state
      ((start)
       (print "Trying to start server")
       (server:kind-run run-id)
       (loop 'server-started))
      ((server-started)
       (case (vector-ref first-dat)
	 ((running)
	  (print "Server appears to be running. Now ask it to shutdown")
	  (rmt:kill-server run-id)
	  (loop 'server-shutdown))
	 ((shutting-down)
	  (loop test-state))
	 (else (print "Don't know what to do if get here"))))







|







137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
    (thread-sleep! 1)
    (case test-state
      ((start)
       (print "Trying to start server")
       (server:kind-run run-id)
       (loop 'server-started))
      ((server-started)
       (case (if first-dat (vector-ref first-dat 0) 'blah)
	 ((running)
	  (print "Server appears to be running. Now ask it to shutdown")
	  (rmt:kill-server run-id)
	  (loop 'server-shutdown))
	 ((shutting-down)
	  (loop test-state))
	 (else (print "Don't know what to do if get here"))))