Changes In Branch v1.7001-multi-db-wip2 Through [bd65c1e661] Excluding Merge-Ins
This is equivalent to a diff from 5209afd099 to bd65c1e661
2022-04-21
| ||
19:10 | implemented db:get-db with extra runid arg check-in: c201b33851 user: matt tags: v1.7001-rebase-wip, v1.7001-multi-db-rb01 | |
2022-04-12
| ||
07:15 | Merged back to v1.7001-multi-db check-in: 689ac0bf5f user: matt tags: v1.7001-multi-db-rb01 | |
07:15 | no-sync db and db open locking working. Closed-Leaf check-in: a82e2bb971 user: matt tags: v1.7001-multi-db-wip2, v1.7001-multi-db-rb01 | |
2022-04-11
| ||
21:43 | wip check-in: bd65c1e661 user: matt tags: v1.7001-multi-db-wip2, v1.7001-multi-db-rb01 | |
2022-04-10
| ||
20:05 | Merged Martin's fix. Got commonmod, debugprint and mtargs modules working check-in: 911725fc69 user: matt tags: v1.7001-multi-db-wip, v1.7001-multi-db-rb01 | |
2022-04-07
| ||
07:04 | wip check-in: 5209afd099 user: matt tags: v1.7001-multi-db-rb01 | |
06:38 | sync working? check-in: f2cf1492f8 user: matt tags: v1.7001-multi-db-rb01 | |
Modified api.scm from [fcdb3b5c5f] to [b65cdceb6b].
︙ | |||
144 145 146 147 148 149 150 151 152 153 154 155 156 157 | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | + | ;; These are called by the server on recipt of /api calls ;; - keep it simple, only return the actual result of the call, i.e. no meta info here ;; ;; - returns #( flag result ) ;; (define (api:execute-requests dbstruct dat) (db:open-no-sync-db) ;; sets *no-sync-db* (handle-exceptions exn (let ((call-chain (get-call-chain))) (debug:print 0 *default-log-port* "WARNING: api:execute-requests received an exception from peer, dat=" dat ", exn=" exn) (print-call-chain (current-error-port)) (debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn)) (vector #f (vector exn call-chain dat))) ;; return some stuff for debug if an exception happens |
︙ |
Modified db.scm from [40daf428a9] to [5c6fcf9a46].
︙ | |||
210 211 212 213 214 215 216 | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + | (use-mutex (> *api-process-request-count* 25))) ;; was 25 (if (and use-mutex (common:low-noise-print 120 "over-50-parallel-api-requests")) (debug:print-info 0 *default-log-port* *api-process-request-count* " parallel api requests being processed in process " (current-process-id) ", throttling access")) (if (common:low-noise-print 600 (conc "parallel-api-requests" *max-api-process-requests*)) (debug:print-info 2 *default-log-port* "Parallel api request count: " *api-process-request-count* " max parallel requests: " *max-api-process-requests*)) (condition-case |
︙ | |||
2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 | 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 | + + + + + + + + + + + + + + + + + | (db:with-db dbstruct #f #t (lambda (dbdat db) (sqlite3:execute db "DELETE FROM metadat WHERE var=?;" var)))) ;;====================================================================== ;; no-sync.db - small bits of data to be shared between servers ;;====================================================================== (define (db:no-sync-db db-in) (if db-in db-in (if *no-sync-db* *no-sync-db* (begin (mutex-lock! *db-access-mutex*) (let ((dbpath (common:get-db-tmp-area)) (db (dbfile:open-no-sync-db dbpath))) (set! *no-sync-db* db) (mutex-unlock! *db-access-mutex*) db))))) (define (with-no-sync-db proc) (let* ((db (db:no-sync-db *no-sync-db*))) (proc db))) (define (db:open-no-sync-db) (dbfile:open-no-sync-db (db:dbfile-path))) (define (db:no-sync-close-db db stmt-cache) (db:safely-close-sqlite3-db db stmt-cache)) |
︙ | |||
5007 5008 5009 5010 5011 5012 5013 | 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 | + - - + + + + + + + + + | (dbfiles (glob (conc tmp-area"/.db/*.db"))) (sync-durations (make-hash-table))) ;; (debug:print-info 0 *default-log-port* "lock-and-sync, dbfiles: "dbfiles) (for-each (lambda (file) (let* ((fname (conc (pathname-file file) ".db")) (fulln (conc *toppath*"/.db/"fname)) (time1 (if (file-exists? file) |
︙ |
Modified dbfile.scm from [c5ec4d8a51] to [13bb3140b5].
︙ | |||
442 443 444 445 446 447 448 | 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 | - - - - - - + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + - - + + - + - + - + - + - + - + - - - - - - + + + + + - + | ;; no-sync.db - small bits of data to be shared between servers ;;====================================================================== ;; if we are not a server create a db handle. this is not finalized ;; so watch for problems. I'm still not clear if it is needed to manually ;; finalize sqlite3 dbs with the sqlite3 egg. ;; |
︙ |
Modified http-transport.scm from [df8bc9e37e] to [4a4c885dbb].
︙ | |||
401 402 403 404 405 406 407 408 409 410 411 412 413 414 | 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 | + | ;; (define (http-transport:keep-running) ;; if none running or if > 20 seconds since ;; server last used then start shutdown ;; This thread waits for the server to come alive (debug:print-info 0 *default-log-port* "Starting the sync-back, keep alive thread in server") (let* ((sdat #f) (no-sync-db (db:open-no-sync-db)) (tmp-area (common:get-db-tmp-area)) (started-file (conc tmp-area "/.server-started")) (server-start-time (current-seconds)) (server-info (let loop ((start-time (current-seconds)) (changed #t) (last-sdat "not this")) (begin ;; let ((sdat #f)) |
︙ |
Modified tasks.scm from [19e9ab848e] to [e54ee89bd7].
︙ | |||
512 513 514 515 516 517 518 | 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 | - - - - - - - - - - + + + + + + + + + - - + + | exn '() (sqlite3:first-row db "SELECT id,action,owner,state,target,name,testpatt,keylock,params WHERE params LIKE ? AND state LIKE ? AND action LIKE ? AND testpatt LIKE ?;" param-key state-patt action-patt test-patt))))) (define (tasks:find-task-queue-records dbstruct target run-name test-patt state-patt action-patt) |
︙ |
Modified tests/simplerun/Makefile from [115e15e0c2] to [d958b22b7d].
1 2 3 | 1 2 3 4 5 | - + | cleanup : killall mtest dboard -v -9 || true |