Megatest

Diff
Login

Differences From Artifact [2239dfb672]:

To Artifact [22faa8bbb3]:


562
563
564
565
566
567
568
























569
570
571
572
573
574
575
576
			(debug:print 0 *default-log-port* "WARNING: received a stop server from client by remote request.")
			#f)
		       ((null? servers) #f) ;; not ok
		       ((equal? (list-ref (car servers) 6) ;; compare the servinfofile
				(tt-servinf-file ttdat))
			(let* ((res (if db-locked-in
					#t
























					(let* ((lock-result  ;; this is the primary lock - need to double verify that got it
						(dbfile:with-no-sync-db
						 nosyncdbpath
						 (lambda (db)
						   (db:no-sync-lock-and-check db dbfname
									      (tt-servinf-file ttdat)
									      ;; (dbr:dbstruct-dbtmpname dbstruct)
									      ))))







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|







562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
			(debug:print 0 *default-log-port* "WARNING: received a stop server from client by remote request.")
			#f)
		       ((null? servers) #f) ;; not ok
		       ((equal? (list-ref (car servers) 6) ;; compare the servinfofile
				(tt-servinf-file ttdat))
			(let* ((res (if db-locked-in
					#t
					;;
					;; let's replace the below "winning" lock method with:
					;;  1. create a lock file with pid etc.
					;;  2. if there are no other lock files make an entry in the no-sync db
					;;  3. gather the lock entries, apply the "winner" heuristic
					;;  4. if I'm the winner, set tt-state to 'running else set to 'notthewinner
					;;
					;; New idea:
					;;  1. check all processes entries that match the db
					;;  2. sort by fixed heuristic
					;;  3. if I'm number one, set state to 'running and db-locked-in to #t
					(let* ((candidates (dbfile:with-no-sync-db
							     nosyncdbpath
							     (lambda (nsdb)
							       (dbfile:get-process-options nsdb "server" dbfname))))
					       (primecand  (begin
							     (assert (not (null? candidates))
								     "HOW CAN WE NOT BE IN THE PROCESSES DB AS A SERVER?")
							     (dbfile:row->procinf (car candidates)))))
					  ;; compare primecand with myself
					  ;; if not me check that it is reachable
					  ;;   if reachable exit
					  #f)
					
					#;(let* ((lock-result  ;; this is the primary lock - need to double verify that got it
						(dbfile:with-no-sync-db
						 nosyncdbpath
						 (lambda (db)
						   (db:no-sync-lock-and-check db dbfname
									      (tt-servinf-file ttdat)
									      ;; (dbr:dbstruct-dbtmpname dbstruct)
									      ))))