Changes In Branch v1.70-nohomehost Through [cc546c7dfe] Excluding Merge-Ins
This is equivalent to a diff from bf877ecde8 to cc546c7dfe
2022-11-20
| ||
08:34 | Couple minor changes to where client connections are cleared. check-in: ae21734c5e user: matt tags: v1.70 | |
2022-11-18
| ||
12:53 | rebased newdashboard branch forward on v1.70 check-in: 5820f690ed user: mrwellan tags: v1.70-ndboard | |
2022-11-12
| ||
19:25 | Most routines needed for no-homehost updated. check-in: ed25403d77 user: matt tags: v1.70-nohomehost | |
18:34 | server:choose-server now working. check-in: cc546c7dfe user: matt tags: v1.70-nohomehost | |
07:03 | Steps towards eliminating homehost check-in: a0384d728b user: matt tags: v1.70-nohomehost | |
2022-11-11
| ||
09:42 | Partial implementation of homehost-free check-in: ac69021df7 user: matt tags: v1.70-nohomehost | |
2022-11-10
| ||
13:37 | Fixed server/client signature. I think. check-in: bf877ecde8 user: matt tags: v1.70 | |
2022-11-08
| ||
22:15 | Added stop-the-train, crowbar switch check-in: bf43672760 user: matt tags: v1.70 | |
Modified archive.scm from [9231707c41] to [5c03589f24].
︙ | |||
344 345 346 347 348 349 350 | 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | - + | (archiver (let ((s (configf:lookup *configdat* "archive" "archiver"))) (if s (string->symbol s) 'bup))) (rsync-exe (or (configf:lookup *configdat* "archive" "rsync") "rsync")) (print-prefix "Running: ") (archive-info (archive:allocate-new-archive-block blockid-cache *toppath* tsname min-space target-patt run-patt "megatest-db")) (archive-dir (if archive-info (cdr archive-info) #f)) (archive-id (if archive-info (car archive-info) -1)) |
︙ |
Modified client.scm from [3f204dd646] to [17a8862d81].
︙ | |||
105 106 107 108 109 110 111 | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | - - + - - + | (set! *runremote* (make-remote)) (let* ((server-info (remote-server-info *runremote*))) (if server-info (begin (remote-server-url-set! *runremote* (server:record->url server-info)) (remote-server-id-set! *runremote* (server:record->id server-info))))))) (if (and host port server-id) |
︙ |
Modified common.scm from [7a004393e6] to [c4aca77534].
︙ | |||
140 141 142 143 144 145 146 147 148 149 150 151 152 153 | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | + | (define *test-meta-updated* (make-hash-table)) (define *globalexitstatus* 0) ;; attempt to work around possible thread issues (define *passnum* 0) ;; when running track calls to run-tests or similar ;; (define *alt-log-file* #f) ;; used by -log ;; (define *common:denoise* (make-hash-table)) ;; for low noise printing (define *default-log-port* (current-error-port)) (define *time-zero* (current-seconds)) ;; for the watchdog (define *on-exit-procs* '()) ;; add procs to this list to be executed on exit (define *default-area-tag* "local") ;; DATABASE ;; (define *dbstruct-dbs* #f) ;; used to cache the dbstruct in db:setup. Goal is to remove this. ;; db stats (define *db-stats* (make-hash-table)) ;; hash of vectors < count duration-total > (define *db-stats-mutex* (make-mutex)) |
︙ | |||
313 314 315 316 317 318 319 | 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | - + | ((skip) "SKIP") (else "FAIL"))) (define (common:logpro-exit-code->test-status exit-code) (status-sym->string (common:logpro-exit-code->status-sym exit-code))) (defstruct remote |
︙ | |||
1303 1304 1305 1306 1307 1308 1309 | 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | #f)) ;;====================================================================== ;; logic for getting homehost. Returns (host . at-home) ;; IF *toppath* is not set, wait up to five seconds trying every two seconds ;; (this is to accomodate the watchdog) ;; |
︙ | |||
2047 2048 2049 2050 2051 2052 2053 | 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 | - + | (host-last-used-set! rec curr-time) new-best) (if (null? tal) #f (loop (car tal)(cdr tal) best-host))))))))) (define (common:wait-for-homehost-load maxnormload msg) (let* ((hh-dat (if (common:on-homehost?) ;; if we are on the homehost then pass in #f so the calls are local. #f |
︙ | |||
3342 3343 3344 3345 3346 3347 3348 | 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 | - + + | (string-split pktsdirs-str " ") #f))) pktsdirs)) ;;====================================================================== ;; use-lt is use linktree "lt" link to find pkts dir (define (common:save-pkt pktalist-in mtconf use-lt #!key (add-only #f)) ;; add-only saves the pkt only if there is a parent already |
︙ |
Modified dashboard.scm from [6283f67b19] to [d1f71cff63].
︙ | |||
3808 3809 3810 3811 3812 3813 3814 | 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 | - + | (debug:print 0 *default-log-port* "Failed to find megatest.config, exiting") (exit 1) ) ) (if (not (common:on-homehost?)) (begin |
︙ |
Modified db.scm from [d143149924] to [eca8c190a3].
︙ | |||
4584 4585 4586 4587 4588 4589 4590 | 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 | - + - + + + + + + + | (if (common:low-noise-print 30) (debug:print-info 0 *default-log-port* "Exiting watchdog timer, *time-to-exit* = " *time-to-exit*" pid="(current-process-id) )))) )) (define (std-exit-procedure) ;;(common:telemetry-log-close) |
︙ |
Modified http-transport.scm from [d2af089e7c] to [3205da4502].
︙ | |||
424 425 426 427 428 429 430 | 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 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 | + + + + + + + + + + + + - + + + - + - + + + + - + | (debug:print-info 0 *default-log-port* "Waiting for server alive signature") (mutex-lock! *heartbeat-mutex*) (set! sdat *server-info*) (mutex-unlock! *heartbeat-mutex*) (if (and sdat (not changed) (> (- (current-seconds) start-time) 2)) (let* ((servinfodir (conc *toppath*"/.servinfo")) (ipaddr (car sdat)) (port (cadr sdat)) (servinf (conc servinfodir"/"ipaddr":"port))) (if (not (file-exists? servinfodir)) (create-directory servinfodir #t)) (with-output-to-file servinf (lambda () (print "SERVER STARTED: "ipaddr":"port" AT "(current-seconds)" server-id: "(server:get-client-signature)) (print "started: "(seconds->year-week/day-time (current-seconds))))) (set! *on-exit-procs* (cons (lambda () |
︙ | |||
598 599 600 601 602 603 604 | 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 | - + - + + + + | ;; (if (eq? *number-non-write-queries* 0) ;; "n/a (no queries)" ;; (/ *total-non-write-delay* ;; *number-non-write-queries*)) ;; " ms") (db:print-current-query-stats) |
︙ | |||
638 639 640 641 642 643 644 | 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 | - - - - + + + + | (exit))) ;; lets not even bother to start if there are already three or more server files ready to go #;(let* ((num-alive (server:get-num-alive (server:get-list *toppath*)))) (if (> num-alive 3) (begin (cleanup-proc (conc "ERROR: Aborting server start because there are already " num-alive " possible servers either running or starting up")) (exit)))) |
︙ |
Modified launch.scm from [60d380c61b] to [56e9ef9407].
︙ | |||
1561 1562 1563 1564 1565 1566 1567 | 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 | - + | (set! cmdparms (base64:base64-encode (z3:encode-buffer (with-output-to-string (lambda () ;; (list 'hosts hosts) (write (list (list 'testpath test-path) ;; (list 'transport (conc *transport-type*)) ;; (list 'serverinf *server-info*) |
︙ |
Modified megatest.scm from [7c70251ef1] to [b4770c25e0].
︙ | |||
654 655 656 657 658 659 660 | 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 | - + | ;; for some switches always print the command to stderr ;; (if (args:any? "-run" "-runall" "-remove-runs" "-set-state-status" "-kill-runs" "-kill-rerun") (debug:print 0 *default-log-port* (string-intersperse (argv) " "))) ;; some switches imply homehost. Exit here if not on homehost ;; |
︙ |
Modified rmt.scm from [4af82949dd] to [a7494b375d].
︙ | |||
114 115 116 117 118 119 120 | 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | - + | ;; DOT SET_HOMEHOST; // leaving off - doesn't really add to the clarity ;; DOT MUTEXLOCK -> SET_HOMEHOST [label="no homehost?"]; ;; DOT SET_HOMEHOST -> MUTEXLOCK; ;; ensure we have a homehost record (if (not (pair? (remote-hh-dat runremote))) ;; not on homehost (thread-sleep! 0.1) ;; since we shouldn't get here, delay a little |
︙ |
Modified server.scm from [b0155e0a8d] to [b8fe843658].
︙ | |||
124 125 126 127 128 129 130 | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | - + | ;; (define (server:run areapath) ;; areapath is *toppath* for a given testsuite area (let* ((curr-host (get-host-name)) ;; (attempt-in-progress (server:start-attempted? areapath)) ;; (dot-server-url (server:check-if-running areapath)) (curr-ip (server:get-best-guess-address curr-host)) (curr-pid (current-process-id)) |
︙ | |||
324 325 326 327 328 329 330 331 332 333 334 335 336 337 | 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | + + | (lambda (a b) (< (list-ref a 3) (list-ref b 3)))))) (if (> (length slst) nums) (take slst nums) slst))) ;; switch from server:get-list to server:get-servers-info ;; (define (server:get-first-best areapath) (let ((srvrs (server:get-best (server:get-list areapath)))) (if (and srvrs (not (null? srvrs))) (car srvrs) #f))) |
︙ | |||
375 376 377 378 379 380 381 | 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | - + | *my-client-signature*))) ;; if server-start-last exists, and wasn't old enough, wait <idle time> + 1, then call this function recursively until it is old enough. ;; if it is old enough, overwrite it and wait 0.25 seconds. ;; if it then has the wrong server key, wait <idle time> + 1 and call this function recursively. ;; |
︙ | |||
403 404 405 406 407 408 409 410 | 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + | (begin (debug:print-info 0 *default-log-port* "Gating server start, last start: " (seconds->time-string fmodtime) ", time since last start: " delta ", required idletime: " idletime ", gating reason:" (if old-enough "another job started a server" "too soon to start another server")) (thread-sleep! ( + 1 idletime)) (server:wait-for-server-start-last-flag areapath))))))) ;; oldest server alive determines host then choose random of youngest ;; five servers on that host ;; (define (server:get-servers-info areapath) (let* ((servinfodir (conc *toppath*"/.servinfo")) (allfiles (glob (conc servinfodir"/*"))) (res (make-hash-table))) (for-each (lambda (f) (let* ((hostport (pathname-strip-directory f)) (serverdat (server:logf-get-start-info f))) (hash-table-set! res hostport serverdat))) allfiles) res)) ;; oldest server alive determines host then choose random of youngest ;; five servers on that host ;; ;; mode: ;; best - get best server (random of newest five) ;; home - get home host based on oldest server ;; info - print info (define (server:choose-server areapath #!optional (mode 'best)) ;; age is current-starttime ;; find oldest alive ;; 1. sort by age ascending and ping until good ;; find alive rand from youngest ;; 1. sort by age descending ;; 2. take five ;; 3. check alive, discard if not and repeat (let* ((serversdat (server:get-servers-info areapath)) (by-time-asc (sort (hash-table-keys serversdat) ;; list of "host:port" (lambda (a b) (>= (list-ref (hash-table-ref serversdat a) 2) (list-ref (hash-table-ref serversdat b) 2)))))) (if (not (null? by-time-asc)) (let* ((oldest (last by-time-asc)) (oldest-dat (hash-table-ref serversdat oldest)) (host (list-ref oldest-dat 0)) (all-valid (filter (lambda (x) (equal? host (list-ref (hash-table-ref serversdat x) 0))) by-time-asc))) (case mode ((info) (print "oldest: "oldest-dat", selected host: "host", all-valid: "all-valid) (print "youngest: "(hash-table-ref serversdat (car all-valid)))) ((home) host) ((best)(if (> (length all-valid) 5) (map (lambda (x) (hash-table-ref serversdat x)) (take all-valid 5)) all-valid)) (else (debug:print 0 *default-log-port* "ERROR: invalid command "mode) #f))) #f))) |
︙ |