Overview
Comment: | Moved few functions around. Added beginnings of being able to use /tmp/ db in place of inmem |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.80 |
Files: | files | file ages | folders |
SHA1: |
5e665a1f75ea85d4ba942eed42453d21 |
User & Date: | matt on 2023-04-06 22:32:44 |
Other Links: | branch diff | manifest | tags |
Context
2023-04-07
| ||
03:56 | For /tmp db cache disambiguate the db with pid check-in: 481acc5191 user: matt tags: v1.80 | |
2023-04-06
| ||
22:32 | Moved few functions around. Added beginnings of being able to use /tmp/ db in place of inmem check-in: 5e665a1f75 user: matt tags: v1.80 | |
20:25 | Cherrypicked fix for ticket c10775f9d83a4e29f50f9ccdbfc9fd326f493e2e from e37f check-in: 8982b550f7 user: matt tags: v1.80 | |
Changes
Modified api.scm from [feec7eca54] to [2ad118d009].
︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | + + | ;; along with Megatest. If not, see <http://www.gnu.org/licenses/>. ;; ;;====================================================================== (declare (unit api)) (declare (uses db)) (declare (uses debugprint)) (declare (uses commonmod)) (declare (uses dbmod)) (declare (uses dbfile)) (declare (uses tasks)) (declare (uses tcp-transportmod)) (import commonmod) (import dbmod) (import dbfile) (import debugprint) (import tcp-transportmod) (use srfi-69 posix |
︙ |
Modified db.scm from [144c7b38b3] to [29f5956670].
︙ | |||
66 67 68 69 70 71 72 | 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 | - - + + - - - - - - - + + + + + + | (include "key_records.scm") (include "run_records.scm") (define *number-of-writes* 0) (define *number-non-write-queries* 0) (import debugprint) |
︙ | |||
1126 1127 1128 1129 1130 1131 1132 | 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 | - + + + | (with-input-from-file infile read-lines) ))) ;; select end_time-now from ;; (select testname,item_path,event_time+run_duration as ;; end_time,strftime('%s','now') as now from tests where state in ;; ('RUNNING','REMOTEHOSTSTART','LAUNCHED')); |
︙ | |||
1382 1383 1384 1385 1386 1387 1388 | 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | (map sqlite3:finalize! statements) (sqlite3:finalize! count-stmt) ;; (db:find-and-mark-incomplete db) ;; (db:delay-if-busy dbdat) (sqlite3:execute db "VACUUM;") dead-runs)) |
︙ | |||
1498 1499 1500 1501 1502 1503 1504 | 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 | - - - - - - - + + + - - - - - - + + + + + + - - + - - | (define (db:get-header vec)(vector-ref vec 0)) (define (db:get-rows vec)(vector-ref vec 1)) ;;====================================================================== ;; R U N S ;;====================================================================== |
︙ |
Modified dbfile.scm from [133c3d1663] to [50f8ec9e6b].
︙ | |||
1141 1142 1143 1144 1145 1146 1147 | 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (loop (+ count 1)))))) (with-output-to-file crumbn (lambda () (print fname" run-id="run-id" params="params) )) crumbn)) |
︙ |
Modified dbmod.scm from [08e196df1c] to [5d007769fc].
︙ | |||
82 83 84 85 86 87 88 | 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 119 120 121 122 | + - - - + + + + - + + + + + + - - + + + + - + | newdbstruct)))) ;;====================================================================== ;; The inmem one-db file per server method goes in here ;;====================================================================== (define (dbmod:with-db dbstruct run-id r/w proc params) (let* ((use-mutex (> *api-process-request-count* 15)) |
︙ | |||
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | + + + + + + + + + + + - + + + - + - - - - - - - - | (else (debug:print 0 *default-log-port* "Unknown dbfile:sync-method setting: " (dbfile:sync-method))))) (else (debug:print 0 *default-log-port* "Unknown dbfile:cache-method setting: " (dbfile:cache-method)) #f))) (define (dbmod:safely-open-db dbfullname init-proc write-access) (dbfile:with-simple-file-lock (conc dbfullname".lock") (lambda () (let* ((db (sqlite3:open-database dbfullname)) (handler (sqlite3:make-busy-timeout 136000))) (sqlite3:set-busy-handler! db handler) (if write-access (init-proc db)) db)))) ;; Open the inmem db and the on-disk db ;; populate the inmem db with data ;; ;; Updates fields in dbstruct ;; Returns dbstruct ;; ;; * This routine creates the db if not found ;; * Probably can get rid of the dbstruct-in ;; (define (dbmod:open-dbmoddb areapath run-id dbfname-in init-proc keys #!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)) |
︙ | |||
567 568 569 570 571 572 573 574 575 | 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 | + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (loop (file-exists? fullpath) (- count 1))) (begin (debug:print 0 *default-log-port* "ERROR: removing the journal file " fullpath ", this is not good. Look for disk full, write access and other issues.") (if remove (system (conc "rm -rf " fullpath))) #f))) #t)))))) ;;====================================================================== ;; M E T A G E T A N D S E T V A R S ;;====================================================================== |
Modified tasks.scm from [252d38622d] to [bc2ee35751].
︙ | |||
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 | 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 | + + | ;; strftime('%m/%d/%Y %H:%M:%S','now','localtime') (declare (unit tasks)) (declare (uses debugprint)) (declare (uses dbfile)) (declare (uses db)) (declare (uses dbmod)) (declare (uses rmt)) (declare (uses rmtmod)) (declare (uses common)) (declare (uses pgdb)) (declare (uses commonmod)) (declare (uses mtargs)) (use sqlite3 srfi-1 posix regex regex-case srfi-69 dot-locking format) (import (prefix sqlite3 sqlite3:)) (import commonmod debugprint dbmod rmtmod (prefix mtargs args:)) (import dbfile) ;; (import pgdb) ;; pgdb is a module (include "task_records.scm") |
︙ |