Overview
Comment: | Centralize server starts to server 0 and pace out same-run-id starts by 40 seconds |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.60 |
Files: | files | file ages | folders |
SHA1: |
837646d7e82ead63c83bdee17c13db73 |
User & Date: | matt on 2014-02-25 23:11:08 |
Other Links: | branch diff | manifest | tags |
Context
2014-02-26
| ||
14:36 | Partial fix to server start issue (breaks startup when db contains dead server). check-in: 05fa3869fb user: mrwellan tags: v1.60 | |
2014-02-25
| ||
23:11 | Centralize server starts to server 0 and pace out same-run-id starts by 40 seconds check-in: 837646d7e8 user: matt tags: v1.60 | |
20:53 | Added some missing checks for deleted in queries for runs check-in: 8f59526787 user: matt tags: v1.60 | |
Changes
Modified api.scm from [7b83b1f06b] to [be6d379826].
︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | + + + + + + + + + + + + + + + + + + + + | (declare (uses rmt)) (declare (uses db)) ;; These are called by the server on recipt of /api calls (define (api:execute-requests dbstruct cmd params) (case (string->symbol cmd) ;; SERVERS ((start-server) (apply server:kind-run params)) ;; ((kill-server) ;; (db:sync-tables (db:tbls *inmemdb*) *inmemdb* *db*) ;; (db:sync-to *inmemdb* *db*) ;; (let ((hostname (car *runremote*)) ;; (port (cadr *runremote*)) ;; (pid (if (null? params) #f (car params))) ;; (th1 (make-thread (lambda ()(thread-sleep! 3)(debug:print 0 "Server exiting!")(exit 0)) "Server exit thread"))) ;; (debug:print 0 "WARNING: Server on " hostname ":" port " going down by user request!") ;; (debug:print-info 1 "current pid=" (current-process-id)) ;; (open-run-close tasks:server-deregister tasks:open-db ;; hostname ;; port: port) ;; (set! *server-run* #f) ;; (thread-sleep! 3) ;; (if pid ;; (process-signal pid signal/kill) ;; (thread-start! th1)) ;; '(#t "exit process started"))) ;; KEYS ((get-key-val-pairs) (apply db:get-key-val-pairs dbstruct params)) ((get-keys) (db:get-keys dbstruct)) ;; TESTS ;; json doesn't do vectors, convert to list ((get-test-info-by-id) (apply db:get-test-info-by-id dbstruct params)) |
︙ | |||
72 73 74 75 76 77 78 | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | - - - - - - - - - - - - - - - - - | ((general-call) (let ((stmtname (car params)) (run-id (cadr params)) (realparams (cddr params))) (db:with-db dbstruct run-id #t ;; these are all for modifying the db (lambda (db) (db:general-call db stmtname realparams))))) ((sync-inmem->db) (db:sync-touched dbstruct run-id force-sync: #t)) |
︙ |
Modified client.scm from [c34489a609] to [470e0682b1].
︙ | |||
102 103 104 105 106 107 108 | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | - - - - + + + + + + + + + | (server:try-running run-id) (thread-sleep! 10) ;; give server a little time to start up (client:setup run-id remaining-tries: 10)) ;; (- remaining-tries 1))) (begin (thread-sleep! 5) (client:setup run-id remaining-tries: (- remaining-tries 1)))))) (begin ;; no server registered |
︙ |
Modified common.scm from [98ab0c8aab] to [8ab78fa41e].
︙ | |||
65 66 67 68 69 70 71 72 73 74 75 76 77 78 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | + | (define *time-to-exit* #f) (define *received-response* #f) (define *default-numtries* 10) (define *server-run* #t) (define *db-write-access* #t) (define *inmemdb* #f) (define *run-id* #f) (define *server-kind-run* (make-hash-table)) (define *target* (make-hash-table)) ;; cache the target here; target is keyval1/keyval2/.../keyvalN (define *keys* (make-hash-table)) ;; cache the keys here (define *keyvals* (make-hash-table)) (define *toptest-paths* (make-hash-table)) ;; cache toptest path settings here (define *test-paths* (make-hash-table)) ;; cache test-id to test run paths here (define *test-ids* (make-hash-table)) ;; cache run-id, testname, and item-path => test-id |
︙ |
Modified http-transport.scm from [e1da68c36b] to [c4fe5c65f6].
︙ | |||
142 143 144 145 146 147 148 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | + + - + | (begin (debug:print 0 "WARNING: failed to start on portnum: " portnum ", trying next port") (thread-sleep! 0.1) ;; get_next_port goes here (http-transport:try-start-server ipaddrstr (+ portnum 1) server-id)) (begin (open-run-close tasks:server-delete tasks:open-db ipaddrstr portnum " http-transport:try-start-server") |
︙ |
Modified rmt.scm from [a00bf53eda] to [3da7dfaf01].
︙ | |||
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | + + + + + + + + + + - - - | (json-read)))) ;;====================================================================== ;; ;; A C T U A L A P I C A L L S ;; ;;====================================================================== ;;====================================================================== ;; S E R V E R ;;====================================================================== (define (rmt:kill-server run-id) (rmt:send-receive 'kill-server run-id (list run-id))) (define (rmt:start-server run-id) (rmt:send-receive 'start-server 0 (list run-id))) ;;====================================================================== ;; M I S C ;;====================================================================== (define (rmt:login run-id) (rmt:send-receive 'login run-id (list *toppath* megatest-version run-id *my-client-signature*))) ;; This login does no retries under the hood - it acts a bit like a ping. ;; (define (rmt:login-no-auto-client-setup connection-info run-id) (rmt:send-receive-no-auto-client-setup connection-info 'login run-id (list *toppath* megatest-version run-id *my-client-signature*))) |
︙ |
Modified server.scm from [9a921aa4ae] to [c4fc1a172b].
︙ | |||
44 45 46 47 48 49 50 | 44 45 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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - + + + + - + + + + + + + + + + + + + + + + + + | ;; ;; all routes though here end in exit ... ;; ;; start_server ;; (define (server:launch run-id) |
︙ |