Overview
Comment: | Added switchable support for db on /tmp instead of inmem. Added couple asserts to help find why run-id and servers are not aligned in some cases. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.80 |
Files: | files | file ages | folders |
SHA1: |
cfcc13973cae9eeaff6bacca9085fe94 |
User & Date: | matt on 2023-04-07 08:25:40 |
Other Links: | branch diff | manifest | tags |
Context
2023-04-09
| ||
13:27 | Added host name to messages about server not started check-in: 21f45d51cf user: mmgraham tags: v1.80 | |
2023-04-08
| ||
02:45 | Removed assert from simple lock. Removed use of statement cache which fixed bind issues check-in: 532f050f93 user: matt tags: v1.80 | |
2023-04-07
| ||
08:25 | Added switchable support for db on /tmp instead of inmem. Added couple asserts to help find why run-id and servers are not aligned in some cases. check-in: cfcc13973c user: matt tags: v1.80 | |
03:56 | For /tmp db cache disambiguate the db with pid check-in: 481acc5191 user: matt tags: v1.80 | |
Changes
Modified dbfile.scm from [50f8ec9e6b] to [cf63c9cd5f].
︙ | |||
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | + - - + + + + + + - + + - + + | #;(db:safely-close-sqlite3-db rdb #f))) ;; stmt-cache))))) ;; (if (sqlite3:database? rdb) (sqlite3:finalize! rdb)))))) subdbs) #t ) #f ) ) (define (dbfile:run-id->path apath run-id) (conc apath"/"(dbfile:run-id->dbname run-id))) (define (db:dbname->path apath dbname) (conc apath"/"dbname)) (define (dbfile:run-id->dbnum run-id) (cond ((number? run-id) (modulo run-id (num-run-dbs))) |
︙ |
Modified dbmod.scm from [722704066d] to [e3fed73fc8].
︙ | |||
39 40 41 42 43 44 45 46 47 48 49 50 51 52 | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | + + | srfi-18 srfi-69 commonmod dbfile debugprint ) (define dbcache-mode (make-parameter 'tmp)) ;; 'inmem, 'tmp ;; NOTE: This returns only the name "1.db", "main.db", not the path ;; (define (dbmod:run-id->dbfname run-id) (conc (dbfile:run-id->dbnum run-id)".db")) (define (dbmod:get-dbdir dbstruct) |
︙ | |||
163 164 165 166 167 168 169 170 | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | + + + + + + - + + + | #!key (dbstruct-in #f) (syncdir 'todisk)) (let* ((dbstruct (or dbstruct-in (make-dbr:dbstruct areapath: areapath))) (dbfname (or dbfname-in (dbmod:run-id->dbfname run-id))) (dbpath (dbmod:get-dbdir dbstruct)) ;; directory where all the .db files are kept (dbfullname (conc dbpath"/"dbfname)) ;; (dbmod:run-id->full-dbfname dbstruct run-id)) (dbexists (file-exists? dbfullname)) (tmpdir (conc "/tmp/"(current-user-name))) (tmpdb (let* ((fname (conc tmpdir"/"(current-process-id)"-"dbfname))) (if (not (file-exists? tmpdir))(create-directory tmpdir)) ;; check if tmpdb already exists, either delete it or ;; add something to the name fname)) (inmem (dbmod:open-inmem-db init-proc |
︙ |
Modified rmt.scm from [759d7a27d6] to [35e00a1063].
︙ | |||
126 127 128 129 130 131 132 | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | - - | (if (not runremote) (let* ((newremote (make-and-init-remote areapath))) (set! *runremote* newremote) (set! runremote newremote))) (let* ((dbfname (conc (dbfile:run-id->dbnum run-id)".db"))) ;;(dbfile:run-id->path areapath run-id))) (tt:handler runremote cmd run-id params attemptnum area-dat areapath readonly-mode dbfname testsuite mtexe))) |
︙ |
Modified tcp-transportmod.scm from [09d461be9f] to [a71da4bf27].
︙ | |||
113 114 115 116 117 118 119 | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | + + + - - - + + + + - + | ;; make ttdat visible (define *server-info* #f) (define (tt:make-remote areapath) (make-tt areapath: areapath)) ;; 1 ... or #f ;; and check that dbfname matches. FIXME: the propagation of dbfname and run-id ;; might not make the best sense ;; |
︙ | |||
174 175 176 177 178 179 180 | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | - + | (if (> (- (current-seconds) (tt-last-serv-start ttdat)) 5) ;; really do not want to swamp the machine with servers (begin (debug:print-info 0 *default-log-port* "No server found. Starting one for run-id "run-id" in dbfile "dbfname) (server-start-proc) (tt-last-serv-start-set! ttdat (current-seconds)))) (thread-sleep! 1) (tt:client-connect-to-server ttdat dbfname run-id testsuite))))))) |
︙ | |||
263 264 265 266 267 268 269 | 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | + - + + + + | ;; returns list of (host port startseconds server-id servinfofile) ;; (define (tt:get-server-info-sorted ttdat dbfname) (let* ((areapath (tt-areapath ttdat)) (sfiles (tt:find-server areapath dbfname)) (sdats (filter car (map tt:server-get-info sfiles))) ;; first element is #f if the file disappeared while being read (sorted (sort sdats (lambda (a b) (let* ((starta (list-ref a 2)) |
︙ | |||
427 428 429 430 431 432 433 | 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 | - + + | (> (- (current-seconds)(file-modification-time servinfofile)) 30)) (begin ;; can't ping and file has been on disk 15 seconds, go ahead and try to remove it (debug:print-info 0 *default-log-port* "Removing apparently dead server info file: "servinfofile) (delete-file* servinfofile) #t) ;; not the server but the server is not reachable (begin |
︙ |