Megatest

Check-in [69c6ef28ac]
Login
Overview
Comment:Partial re-implementation (again) of transaction wrapped writes, now working except for transaction within transaction issue
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | newdashboard
Files: files | file ages | folders
SHA1: 69c6ef28acc5277f3cd62fe2b982c5e0265f3a73
User & Date: mrwellan on 2013-03-19 11:26:54
Other Links: branch diff | manifest | tags
Context
2013-03-19
13:29
Added logic to not attempt to process cached-writes if they were processed within the last 400 ms. Added stats on cached writes check-in: 04ba871116 user: mrwellan tags: newdashboard
11:26
Partial re-implementation (again) of transaction wrapped writes, now working except for transaction within transaction issue check-in: 69c6ef28ac user: mrwellan tags: newdashboard
11:22
Partial re-implementation (again) of transaction wrapped writes, now working except for transaction within transaction issue check-in: 7bbc43c98d user: mrwellan tags: newdashboard
Changes

Modified db.scm from [5fd4db1042] to [69d9359c67].

1407
1408
1409
1410
1411
1412
1413


1414

1415
1416
1417
1418
1419
1420
1421
			   (apply sqlite3:execute db query params)
			   #t))))
	  (debug:print-info 7 "Received " response " from wrapped write")
	  (server:reply return-address qry-sig response response))
	;; otherwise if appropriate flush the queue (this is a read or complex query)
	(begin
	  (case *transport-type*


	    ((http)(db:process-cached-writes db)))

	  (cond
	   ((member stmt-key db:special-queries)
	    (debug:print-info 11 "Handling special statement " stmt-key)
	    (case stmt-key
	      ((immediate)
	       (let ((proc      (car params))
		     (remparams (cdr params)))







>
>
|
>







1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
			   (apply sqlite3:execute db query params)
			   #t))))
	  (debug:print-info 7 "Received " response " from wrapped write")
	  (server:reply return-address qry-sig response response))
	;; otherwise if appropriate flush the queue (this is a read or complex query)
	(begin
	  (case *transport-type*
	    ((http)
	  (mutex-lock! *db:process-queue-mutex*)
	  (db:process-cached-writes db)
	  (mutex-unlock! *db:process-queue-mutex*)))
	  (cond
	   ((member stmt-key db:special-queries)
	    (debug:print-info 11 "Handling special statement " stmt-key)
	    (case stmt-key
	      ((immediate)
	       (let ((proc      (car params))
		     (remparams (cdr params)))

Modified server.scm from [9a280937cc] to [34877c239b].

64
65
66
67
68
69
70

71

72
73
74
75
76
77
78

;; Flush the queue every third of a second. Can we assume that setup-for-run 
;; has already been done?
(define (server:write-queue-handler)
  (if (setup-for-run)
      (let ((db (open-db)))
	(let loop ()

	  (db:process-cached-writes db)

	  (thread-sleep! 0.3)
	  (loop)))
      (begin
	(debug:print 0 "ERROR: failed to setup for Megatest in server:write-queue-handler")
	(exit 1))))
    
;;======================================================================







>

>







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

;; Flush the queue every third of a second. Can we assume that setup-for-run 
;; has already been done?
(define (server:write-queue-handler)
  (if (setup-for-run)
      (let ((db (open-db)))
	(let loop ()
	  (mutex-lock! *db:process-queue-mutex*)
	  (db:process-cached-writes db)
	  (mutex-unlock! *db:process-queue-mutex*)
	  (thread-sleep! 0.3)
	  (loop)))
      (begin
	(debug:print 0 "ERROR: failed to setup for Megatest in server:write-queue-handler")
	(exit 1))))
    
;;======================================================================