Megatest

Check-in [4e02f67409]
Login
Overview
Comment:Fixed couple minor bugs
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.60
Files: files | file ages | folders
SHA1: 4e02f674098f597c469ea10e46d7bfdf2a9807d4
User & Date: matt on 2014-11-18 22:29:11
Other Links: branch diff | manifest | tags
Context
2014-11-19
14:36
Fixed bugs in exit handling check-in: bd18160690 user: mrwellan tags: v1.60
2014-11-18
22:29
Fixed couple minor bugs check-in: 4e02f67409 user: matt tags: v1.60
10:18
reduce print noise. re-start server in long running loop check-in: 127cbef166 user: mrwellan tags: v1.60
Changes

Modified http-transport.scm from [068fb6dcc3] to [d5c0bd2a5f].

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
	    ;; (if (tasks:server-am-i-the-server? tdb run-id)
	    ;;     (tasks:server-set-state! tdb server-id "running"))
	    ;;
	    (loop 0 server-state))
	  (http-transport:server-shutdown server-id port)))))

(define (http-transport:server-shutdown server-id port)

  (debug:print-info 0 "Starting to shutdown the server.")
  ;; need to delete only *my* server entry (future use)
  (set! *time-to-exit* #t)
  (if *inmemdb* (db:sync-touched *inmemdb* *run-id* force-sync: #t))
  ;;
  ;; start_shutdown
  ;;
  (tasks:server-set-state! (db:delay-if-busy tdbdat) server-id "shutting-down")
  (portlogger:open-run-close portlogger:set-port port "released")
  (thread-sleep! 5)
  (debug:print-info 0 "Max cached queries was    " *max-cache-size*)
  (debug:print-info 0 "Number of cached writes   " *number-of-writes*)
  (debug:print-info 0 "Average cached write time "
		    (if (eq? *number-of-writes* 0)
			"n/a (no writes)"
			(/ *writes-total-delay*
			   *number-of-writes*))
		    " ms")
  (debug:print-info 0 "Number non-cached queries "  *number-non-write-queries*)
  (debug:print-info 0 "Average non-cached time   "
		    (if (eq? *number-non-write-queries* 0)
			"n/a (no queries)"
			(/ *total-non-write-delay* 
			   *number-non-write-queries*))
		    " ms")
  (debug:print-info 0 "Server shutdown complete. Exiting")
  (tasks:server-delete-record (db:delay-if-busy tdbdat) server-id " http-transport:keep-running")
  (exit))

;; all routes though here end in exit ...
;;
;; start_server? 
;;
(define (http-transport:launch run-id)
  (let* ((tdbdat (tasks:open-db)))







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







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
	    ;; (if (tasks:server-am-i-the-server? tdb run-id)
	    ;;     (tasks:server-set-state! tdb server-id "running"))
	    ;;
	    (loop 0 server-state))
	  (http-transport:server-shutdown server-id port)))))

(define (http-transport:server-shutdown server-id port)
  (let ((tdbdat (tasks:open-db)))
    (debug:print-info 0 "Starting to shutdown the server.")
    ;; need to delete only *my* server entry (future use)
    (set! *time-to-exit* #t)
    (if *inmemdb* (db:sync-touched *inmemdb* *run-id* force-sync: #t))
    ;;
    ;; start_shutdown
    ;;
    (tasks:server-set-state! (db:delay-if-busy tdbdat) server-id "shutting-down")
    (portlogger:open-run-close portlogger:set-port port "released")
    (thread-sleep! 5)
    (debug:print-info 0 "Max cached queries was    " *max-cache-size*)
    (debug:print-info 0 "Number of cached writes   " *number-of-writes*)
    (debug:print-info 0 "Average cached write time "
		      (if (eq? *number-of-writes* 0)
			  "n/a (no writes)"
			  (/ *writes-total-delay*
			     *number-of-writes*))
		      " ms")
    (debug:print-info 0 "Number non-cached queries "  *number-non-write-queries*)
    (debug:print-info 0 "Average non-cached time   "
		      (if (eq? *number-non-write-queries* 0)
			  "n/a (no queries)"
			  (/ *total-non-write-delay* 
			     *number-non-write-queries*))
		      " ms")
    (debug:print-info 0 "Server shutdown complete. Exiting")
    (tasks:server-delete-record (db:delay-if-busy tdbdat) server-id " http-transport:keep-running")
    (exit)))

;; all routes though here end in exit ...
;;
;; start_server? 
;;
(define (http-transport:launch run-id)
  (let* ((tdbdat (tasks:open-db)))

Modified megatest.scm from [b95fddce4b] to [95c83df933].

323
324
325
326
327
328
329
330
331
332
333
334
335
336

337
338
339
340
341
342
343
(thread-start! *watchdog*)

(define (std-exit-procedure)
  (rmt:print-db-stats)
  (let ((run-ids (hash-table-keys *db-local-sync*)))
    (if (not (null? run-ids))
	(db:multi-db-sync run-ids 'new2old)))
  (if *dbstruct-db* (db:close-all *dbstruct-db*))
  (if *megatest-db* (begin
		      (sqlite3:interrupt! *megatest-db*)
		      (sqlite3:finalize! *megatest-db* #t)))
  (if *task-db*     (let ((db (vector-ref *task-db* 0)))
		      (sqlite3:interrupt! db)
		      (sqlite3:finalize! db #t))))


(define (std-signal-handler signum)
  (signal-mask! signum)
  (debug:print 0 "ERROR: Received signal " signum " exiting promptly")
  (std-exit-procedure)
  (exit))








|
|
|
|
|
|
|
>







323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
(thread-start! *watchdog*)

(define (std-exit-procedure)
  (rmt:print-db-stats)
  (let ((run-ids (hash-table-keys *db-local-sync*)))
    (if (not (null? run-ids))
	(db:multi-db-sync run-ids 'new2old)))
  ;; (if *dbstruct-db* (db:close-all *dbstruct-db*))
  ;; (if *megatest-db* (begin
  ;;       	      (sqlite3:interrupt! *megatest-db*)
  ;;       	      (sqlite3:finalize! *megatest-db* #t)))
  ;; (if *task-db*     (let ((db (vector-ref *task-db* 0)))
  ;;       	      (sqlite3:interrupt! db)
  ;;       	      (sqlite3:finalize! db #t))))
  )

(define (std-signal-handler signum)
  (signal-mask! signum)
  (debug:print 0 "ERROR: Received signal " signum " exiting promptly")
  (std-exit-procedure)
  (exit))

Modified tests/fullrun/megatest.config from [f247f2c8be] to [6b64710311].

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
testcopycmd cp --remove-destination -rsv TEST_SRC_PATH/. TEST_TARG_PATH/. >> TEST_TARG_PATH/mt_launch.log 2>> TEST_TARG_PATH/mt_launch.log

# or for hard links

# testcopycmd cp --remove-destination -rlv TEST_SRC_PATH/. TEST_TARG_PATH/.

# FULL or 2, NORMAL or 1, OFF or 0
synchronous 2
# Throttle roughly scales the db access milliseconds to seconds delay
throttle 0.2
# Max retries allows megatest to re-check that a tests status has changed
# as tests can have transient FAIL status occasionally
maxretries 20

# Setup continued.







|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
testcopycmd cp --remove-destination -rsv TEST_SRC_PATH/. TEST_TARG_PATH/. >> TEST_TARG_PATH/mt_launch.log 2>> TEST_TARG_PATH/mt_launch.log

# or for hard links

# testcopycmd cp --remove-destination -rlv TEST_SRC_PATH/. TEST_TARG_PATH/.

# FULL or 2, NORMAL or 1, OFF or 0
synchronous 0
# Throttle roughly scales the db access milliseconds to seconds delay
throttle 0.2
# Max retries allows megatest to re-check that a tests status has changed
# as tests can have transient FAIL status occasionally
maxretries 20

# Setup continued.