Megatest

Check-in [bc2f918b2f]
Login
Overview
Comment:Correct call to get db in register-run, added exit when race condition causes hostinfo to not be found
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | inmem-per-run-db-per-run-server
Files: files | file ages | folders
SHA1: bc2f918b2fe82e43cd4c4f279af5044abdebee28
User & Date: matt on 2014-01-26 23:33:24
Other Links: branch diff | manifest | tags
Context
2014-01-26
23:41
Added logic to client start to start needed run servers check-in: 5b61400aeb user: matt tags: inmem-per-run-db-per-run-server
23:33
Correct call to get db in register-run, added exit when race condition causes hostinfo to not be found check-in: bc2f918b2f user: matt tags: inmem-per-run-db-per-run-server
23:18
Made most adjustments needed to run inmemdb with per-run server check-in: a0a2377c26 user: matt tags: inmem-per-run-db-per-run-server
Changes

Modified client.scm from [42fb14d698] to [c05aaa49f1].

68
69
70
71
72
73
74




75
76
77
78
79
80
81
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85







+
+
+
+







    (debug:print-info 11 "for run-id=" run-id ", *transport-type* is " *transport-type*)
    (if hostinfo
	hostinfo ;; have hostinfo - just return it
	(let* ((hostinfo  (open-run-close tasks:get-server tasks:open-db run-id))
	       (transport (if hostinfo 
			      (string->symbol (tasks:hostinfo-get-transport hostinfo))
			      'http)))
	  (if (not hostinfo)
	      (begin
		(debug:print 0 "ERROR: Expected to be able to connect to a server by now. No server available for run-id = " run-id)
		(exit 1)))
	  (hash-table-set! *runremote* run-id hostinfo)
	  (debug:print-info 11 "CLIENT SETUP, hostinfo=" hostinfo)
	  (debug:print-info 11 "Using transport type of " transport (if hostinfo (conc " to connect to " hostinfo) ""))
	  (case *transport-type* 
	    ;; ((fs)(if (not *megatest-db*)(set! *megatest-db* (open-db))))
	    ((http)
	     ;; this saves the hostinfo in the *runremote* hash and returns it

Modified db.scm from [72167e48a7] to [8fe1350186].

826
827
828
829
830
831
832
833
834



835
836
837
838
839
840
841
826
827
828
829
830
831
832


833
834
835
836
837
838
839
840
841
842







-
-
+
+
+







				 patts))
			comparator)))


;; register a test run with the db, this accesses the main.db and does NOT
;; use server api
;;
(define (db:register-run db keyvals runname state status user)
  (let* ((keys      (map car keyvals))
(define (db:register-run dbstruct keyvals runname state status user)
  (let* ((db        (db:get-db dbstruct #f))
	 (keys      (map car keyvals))
	 (keystr    (keys->keystr keys))	 
	 (comma     (if (> (length keys) 0) "," ""))
	 (andstr    (if (> (length keys) 0) " AND " ""))
	 (valslots  (keys->valslots keys)) ;; ?,?,? ...
	 (allvals   (append (list runname state status user) (map cadr keyvals)))
	 (qryvals   (append (list runname) (map cadr keyvals)))
	 (key=?str  (string-intersperse (map (lambda (k)(conc k "=?")) keys) " AND ")))