Overview
Comment: | Fixed (kind-of) not working no-sync db based lock |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.70-refactor-procedures |
Files: | files | file ages | folders |
SHA1: |
79a7f8d88363eebe9e12de0ed9676453 |
User & Date: | matt on 2022-06-06 20:25:31 |
Other Links: | branch diff | manifest | tags |
Context
2022-06-07
| ||
08:30 | Added with-lock options for both simple and no-sync locking systems. Leaf check-in: 024073632a user: matt tags: v1.70-refactor-procedures | |
2022-06-06
| ||
20:25 | Fixed (kind-of) not working no-sync db based lock check-in: 79a7f8d883 user: matt tags: v1.70-refactor-procedures | |
18:02 | Added double locking for opening db's check-in: 7b9e186d63 user: matt tags: v1.70-refactor-procedures | |
Changes
Modified dbfile.scm from [81910a6906] to [a601d0637e].
︙ | |||
76 77 78 79 80 81 82 | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | - + + | ) ;; goal is to converge on one struct for an area but for now it is too confusing ;; need to keep dbhandles and cached statements together (defstruct dbr:dbdat (dbfile #f) (dbh #f) (stmt-cache (make-hash-table)) |
︙ | |||
237 238 239 240 241 242 243 | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | - - - + + + + + + + + + + | #f (begin (set! *dbfile:num-handles-in-use* (+ *dbfile:num-handles-in-use* 1)) (stack-pop! (dbr:subdb-dbstack subdb)))))) ;; return a previously opened db handle to the stack of available handles (define (dbfile:add-dbdat dbstruct run-id dbdat) |
︙ | |||
493 494 495 496 497 498 499 | 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 | + - - + + + + - + + + - + | (if (eq? tries-left 2) (begin (dbfile:print-err "INFO: forcing journal rollup "busy-file) (dbfile:brute-force-salvage-db fname))) (dbfile:cautious-open-database fname init-proc (- tries-left 1))) (let* ((db-exists (file-exists? fname)) (result (condition-case (let* ((is-no-sync (substring-index "no-sync.db" fname)) |
︙ | |||
637 638 639 640 641 642 643 | 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | - + - - + + + | (condition-case `(#f . ,(sqlite3:first-result db "SELECT val FROM no_sync_metadat WHERE var=?;" keyname)) (exn (io-error) (dbfile:print-err "ERROR: i/o error with no-sync db. Check permissions, disk space etc. and try again.")) (exn (corrupt) (dbfile:print-err "ERROR: database no-sync db is corrupt. Repair it to proceed.")) (exn (busy) (dbfile:print-err "ERROR: database no-sync db is locked. Try copying to another location, remove original and copy back.")) (exn (permission)(dbfile:print-err "ERROR: database no-sync db has some permissions problem.")) |
︙ |