Changes In Branch v1.65-wip Through [b767764b1a] Excluding Merge-Ins
This is equivalent to a diff from ffb3fa86c6 to b767764b1a
2019-09-30
| ||
11:50 | Added commonmod.scm check-in: 84f39d59fb user: mrwellan tags: v1.65, v1.6535, v1.6536 | |
2019-09-27
| ||
13:45 | Proper handling of errors when db disappears and trigger dropping is happening. check-in: fcf5650f1f user: mrwellan tags: v1.65-wip | |
11:19 | Sync with v1.65 check-in: b767764b1a user: mrwellan tags: v1.65-wip | |
2019-09-26
| ||
23:06 | Improved logs rotation to disallow more than 300 logs (configurable) in the logs dir. check-in: ffb3fa86c6 user: matt tags: v1.65 | |
17:05 | WIP check-in: e300afb35f user: mrwellan tags: v1.65-wip | |
2019-09-25
| ||
16:38 | Merged in the first pass code clean up using modules. This passes unit and ext-tests. check-in: 0d84db9635 user: mrwellan tags: v1.65 | |
Modified common.scm from [8cb8136193] to [3ed4009767].
︙ | |||
277 278 279 280 281 282 283 | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | - + + + | (server-url (if *toppath* (server:check-if-running *toppath*))) ;; (server:check-if-running *toppath*) #f)) (last-server-check 0) ;; last time we checked to see if the server was alive (conndat #f) (transport *transport-type*) (server-timeout (server:expiration-timeout)) (force-server #f) (ro-mode #f) |
︙ |
Added commonmod.scm version [c7972f9b4b].
|
Modified db.scm from [560d632862] to [982bb537f8].
︙ | |||
302 303 304 305 306 307 308 | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | + + + + + + - - - + + + | ;(mtdbmodtime (if mtdbexists (common:lazy-sqlite-db-modification-time mtdbpath) #f)) ; moving this before db:open-megatest-db is called. if wal mode is on -WAL and -shm file get created with causing the tmpdbmodtime timestamp always greater than mtdbmodtime ;(tmpdbmodtime (if dbfexists (common:lazy-sqlite-db-modification-time tmpdbfname) #f)) ;if wal mode is on -WAL and -shm file get created when db:open-megatest-db is called. modtimedelta will always be < 10 so db in tmp not get synced ;(tmpdbmodtime (if dbfexists (db:get-last-update-time (car tmpdb)) #f)) ;(fmt (file-modification-time tmpdbfname)) (modtimedelta (and mtdbmodtime tmpdbmodtime (- mtdbmodtime tmpdbmodtime)))) (handle-exceptions exn (begin (debug:print 0 *default-log-port* "ERROR: attempted to drop triggers on MTRA/megatest.db but failed.") TODO: print real stack and error info (set! write-access #f)) ;; if we failed to drop the triggers then we probably don't have write access |
︙ |
Modified rmt.scm from [5054b48a41] to [4b2cb4ab81].
︙ | |||
23 24 25 26 27 28 29 30 31 32 33 34 35 36 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | + | (declare (unit rmt)) (declare (uses api)) (declare (uses http-transport)) (include "common_records.scm") (declare (uses rmtmod)) (import rmtmod) ;; ;; THESE ARE ALL CALLED ON THE CLIENT SIDE!!! ;; ;; generate entries for ~/.megatestrc with the following ;; |
︙ | |||
52 53 54 55 56 57 58 59 60 | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | + + + + + + + + + + + + + + - + - + | cinfo (if (server:check-if-running areapath) (client:setup areapath) #f)))) (define *send-receive-mutex* (make-mutex)) ;; should have separate mutex per run-id ;; this entry point can decide based on cmd whether to dispatch to old api calls via remote or via ulex ;; (define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f)) (if (member cmd '(blah)) (begin (mutex-lock! *send-receive-mutex*) (if (not *runremote*)(set! *runremote* (make-remote))) (let ((ulex:conn (remote-ulex:conn *runremote*))) (if (not ulex:conn)(remote-ulex:conn-set! *runremote* (rmtmod:setup-ulex *toppath*))) (rmtmod:send-receive-ulex ulex:conn cmd rid params attemptnum area-dat))) (rmt:send-receive-orig cmd rid params attemptnum: attemptnum area-dat: area-dat))) ;; RA => e.g. usage (rmt:send-receive 'get-var #f (list varname)) ;; |
︙ | |||
140 141 142 143 144 145 146 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | - + | (> (current-seconds) ;; if it has been more than server-timeout seconds since last contact, close this connection and start a new on (+ (http-transport:server-dat-get-last-access (remote-conndat runremote)) (remote-server-timeout runremote)))) (debug:print-info 0 *default-log-port* "Connection to " (remote-server-url runremote) " expired due to no accesses, forcing new connection.") (http-transport:close-connections area-dat: runremote) (remote-conndat-set! runremote #f) ;; invalidate the connection, thus forcing a new connection. (mutex-unlock! *rmt-mutex*) |
︙ | |||
166 167 168 169 170 171 172 | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | - + | (not (member cmd api:read-only-queries)) ;; this is a write (remote-server-url runremote) ;; have a server (not (server:ping (remote-server-url runremote)))) ;; server has died. NOTE: this is not a cheap call! Need better approach. (set! *runremote* (make-remote)) (remote-force-server-set! runremote (common:force-server?)) (mutex-unlock! *rmt-mutex*) (debug:print-info 12 *default-log-port* "rmt:send-receive, case 6") |
︙ | |||
212 213 214 215 216 217 218 | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | - + | (and (not (cdr (remote-hh-dat runremote))) ;; not on a homehost (not (remote-conndat runremote)))) ;; and no connection (debug:print-info 12 *default-log-port* "rmt:send-receive, case 9, hh-dat: " (remote-hh-dat runremote) " conndat: " (remote-conndat runremote)) (mutex-unlock! *rmt-mutex*) (if (not (server:check-if-running *toppath*)) ;; who knows, maybe one has started up? (server:start-and-wait *toppath*)) (remote-conndat-set! runremote (rmt:get-connection-info *toppath*)) ;; calls client:setup which calls client:setup-http |
︙ |
Modified rmtmod.scm from [8f5d01960e] to [51e3e5440a].
1 | 1 2 3 4 5 6 7 8 9 | - + | ;;====================================================================== |
︙ | |||
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | + - + | (module rmtmod * (import scheme chicken data-structures extras) (import (prefix sqlite3 sqlite3:) posix typed-records srfi-18) (import commonmod) (use ulex) ;; Hack to make these functions visible to the refactored code, goal is to eliminate these over time. (define (rmt:send-receive . params) #f) (define (http-transport:close-connections . params) #f) ;; from remote defstruct in common.scm (define (remote-conndat-set! . params) #f) (define (remote-server-url-set! . params) #f) (define (remote-ro-mode . params) #f) (define (remote-ro-mode-set! . params) #f) (define (remote-ro-mode-checked-set! . params) #f) (define (remote-ro-mode-checked . params) #f) (define (debug:print . params) #f) (define (debug:print-info . params) #f) (define (set-functions send-receive rsus close-connections rcs dbgp dbgpinfo ro-mode ro-mode-set ro-mode-checked-set ro-mode-checked ) |
︙ | |||
111 112 113 114 115 116 117 118 | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | + + + - + + + + + + + + + + + + + | (mutex-lock! *rmt-mutex*) (http-transport:close-connections area-dat: runremote) (set! *runremote* #f) ;; force starting over (mutex-unlock! *rmt-mutex*) (thread-sleep! wait-delay) (rmt:send-receive cmd rid params attemptnum: (+ attemptnum 1))) res)) ;; All good, return res ;;====================================================================== ;; ulex and steps stuff ;;====================================================================== |