Overview
Comment: | locking of main.db nearly complete |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.6584-ck5 |
Files: | files | file ages | folders |
SHA1: |
336e9917b16585d028b89c0c01debfdd |
User & Date: | matt on 2021-04-29 09:17:37 |
Other Links: | branch diff | manifest | tags |
Context
2021-04-29
| ||
21:58 | wip check-in: f3260cf6bc user: matt tags: v1.6584-ck5 | |
09:17 | locking of main.db nearly complete check-in: 336e9917b1 user: matt tags: v1.6584-ck5 | |
2021-04-28
| ||
23:27 | wip check-in: a758074358 user: matt tags: v1.6584-ck5 | |
Changes
Modified dbmod.scm from [9c5f03fda2] to [2abeb8436f].
︙ | |||
226 227 228 229 230 231 232 | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | - - + + + + + - + - - - - - - - - + + + + + + + - + + + - - - + + + + + + | ;; Make the dbstruct, call for main db at least once ;; sync disk db to inmem ;; ;; called in http-transport and replicated in rmt.scm for *local* access. ;; (define (db:setup run-id) (assert *toppath* "FATAL: db:setup called before toppath is available.") |
︙ |
Modified http-transportmod.scm from [a5cc6ea588] to [51f05a712a].
︙ | |||
94 95 96 97 98 99 100 | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | - + | ;; ;; (use spiffy uri-common intarweb http-client spiffy-request-vars intarweb spiffy-directory-listing) ;; ;; Configurations for server (tcp-buffer-size 2048) (max-connections 2048) |
︙ | |||
224 225 226 227 228 229 230 | 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | - + | ;; get_next_port goes here (http-transport:try-start-server ipaddrstr (portlogger:open-run-close portlogger:find-port))) (begin (print "ERROR: Tried and tried but could not start the server")))) ;; any error in following steps will result in a retry |
︙ | |||
445 446 447 448 449 450 451 452 453 454 455 456 457 458 | 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | + + + + + + + + + | (api-req (make-request method: 'POST uri: api-uri)) (server-dat (vector iface port api-uri api-url api-req (current-seconds) server-id))) server-dat)) ;;====================================================================== ;; NEW SERVER METHOD ;;====================================================================== ;; only use for main.db - need to re-write some of this :( ;; (define (get-lock-db sdat dbfile) (let* ((dbh (db:open-run-db dbfile db:initialize-db)) (res (db:get-iam-server-lock dbh dbfile))) (sqlite3:finalize! dbh) res)) (define *srvpktspec* `((server (host . h) (port . p) (servkey . k) (pid . i) (ipaddr . a) |
︙ | |||
469 470 471 472 473 474 475 | 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | - - - - - | pkts-dir pkt-dat pktspec: pkt-spec ptype: 'server))) (debug:print 0 *default-log-port* "Server on "host":"port" registered in pkt "uuid) uuid)) |
︙ | |||
610 611 612 613 614 615 616 | 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 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 | - + - - + + - + - - + + + + + + + - + - - + + - + - - - - + + + + - - - + + + - - - + + + | ;; create a server pkt in *toppath*/.meta/srvpkts ;; TODO: ;; 1. change sdat to stuct ;; 2. add uuid to struct ;; 3. update uuid in sdat here ;; |
︙ |
Modified launchmod.scm from [6c6ba3f325] to [ba5b81a174].
︙ | |||
461 462 463 464 465 466 467 | 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | - + | (launch:setup) ;; should be properly in the run area home now (set! tconfigreg (tests:get-all)) ;; mapping of testname => test source path (let ((sighand (lambda (signum) ;; (signal-mask! signum) ;; to mask or not? seems to cause issues in exiting (if (eq? signum signal/stop) (debug:print-error 0 *default-log-port* "attempt to STOP process. Exiting.")) |
︙ |
Modified rmtmod.scm from [0f70a2dcff] to [9c11844c69].
︙ | |||
1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 | 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 | + + + + + + | (bdat-time-to-exit-set! *bdat* #t) #t)))) (debug:print-info 4 *default-log-port* "starting exit process, finalizing databases.") (if (and no-hurry (debug:debug-mode 18)) (rmt:print-db-stats)) (let ((th1 (make-thread (lambda () ;; thread for cleaning up, give it five seconds (if *dbstruct-db* (db:close-all *dbstruct-db*)) ;; one second allocated (if *server-info* (let ((pkt-file (conc (get-pkts-dir *toppath*) "/" (servdat-uuid *server-info*) ".pkt"))) (debug:print-info 0 *default-log-port* "removing pkt "pkt-file) (delete-file* pkt-file))) (if (bdat-task-db *bdat*) (let ((db (cdr (bdat-task-db *bdat*)))) (if (sqlite3:database? db) (begin (sqlite3:interrupt! db) (sqlite3:finalize! db #t) ;; (vector-set! (bdat-task-db *bdat*) 0 #f) |
︙ |