Megatest

Check-in [02526c166e]
Login
Overview
Comment:Allow stealing db lock rather than just failing
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.7001 | v1.7001-multi-db-rb01
Files: files | file ages | folders
SHA1: 02526c166ec935ae73894738370c37b50610cd8e
User & Date: mrwellan on 2022-05-09 14:12:12
Other Links: branch diff | manifest | tags
Context
2022-05-15
04:56
Merged all v1.7001-multi-db changes into one commit to rebase forward Closed-Leaf check-in: d9f5072bcb user: matt tags: v1.7001-multi-db-for-rebase
2022-05-09
14:41
No homehost, the beginning. check-in: ae88a2163a user: mrwellan tags: v1.7001-multi-db-nohome
14:12
Allow stealing db lock rather than just failing Closed-Leaf check-in: 02526c166e user: mrwellan tags: v1.7001, v1.7001-multi-db-rb01
07:30
merged fork check-in: 782400400d user: matt tags: v1.7001-multi-db-rb01
Changes

Modified dbfile.scm from [b44432f57b] to [c361d12128].

449
450
451
452
453
454
455




456
457
458
459
460
461
462
		  (if (> tries-left 0)
		      (dbfile:cautious-open-database fname init-proc (- tries-left 1))))))
    (assert (>= tries-left 0) (conc "FATAL: Five attempts in dbfile:cautious-open-database of "fname", giving up."))
    (if (and (file-write-access? fname) (not (dbfile:simple-file-lock lock-file)))
	(begin
	  (dbfile:print-err "INFO: dbfile:cautious-open-database: lock file " lock-file " exists, trying again in 1 second.")
	  (thread-sleep! 1)




	  (dbfile:cautious-open-database fname init-proc (- tries-left 1)))
	(let* ((db-exists (file-exists? fname))
	       (result (condition-case
			   (let* ((db (sqlite3:open-database fname)))
			     (if (and init-proc (not db-exists))
				 (init-proc db))
			     db)







>
>
>
>







449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
		  (if (> tries-left 0)
		      (dbfile:cautious-open-database fname init-proc (- tries-left 1))))))
    (assert (>= tries-left 0) (conc "FATAL: Five attempts in dbfile:cautious-open-database of "fname", giving up."))
    (if (and (file-write-access? fname) (not (dbfile:simple-file-lock lock-file)))
	(begin
	  (dbfile:print-err "INFO: dbfile:cautious-open-database: lock file " lock-file " exists, trying again in 1 second.")
	  (thread-sleep! 1)
	  (if (eq? tries-left 2)
	      (begin
		(dbfile:print-err "INFO: stealing the lock "lock-file)
		(delete-file lock-file)))
	  (dbfile:cautious-open-database fname init-proc (- tries-left 1)))
	(let* ((db-exists (file-exists? fname))
	       (result (condition-case
			   (let* ((db (sqlite3:open-database fname)))
			     (if (and init-proc (not db-exists))
				 (init-proc db))
			     db)