Megatest

Changes On Branch v1.80-refactor-fix1
Login

Changes In Branch v1.80-refactor-fix1 Excluding Merge-Ins

This is equivalent to a diff from 67b18cc991 to a9180a343b

2023-01-18
22:11
Pulled in two needed fixes. check-in: 3936bce446 user: matt tags: v1.80
21:53
corrected misnamed funciton Leaf check-in: a9180a343b user: matt tags: v1.80-refactor-fix1
21:46
Removed bad call to close-connection! check-in: 463fffbd79 user: matt tags: v1.80-refactor-fix1
2023-01-16
12:17
last of overt connection issues addressed. TCP connections growing very slowly. However now the db issues are manifesting. check-in: 22f2c33711 user: matt tags: v1.80-transport-cleanish, v1.80-refactor
10:00
Major refactor/clean up of client connection stuff. Removed old crufty approach of having both client and server side calls in http-transport. Plan would be to eventually get rid of http-transport.

Open files slowly grows. bad argument type in http-transport. Line 285 (close-connection! fullurl) is wrong. check-in: 67b18cc991 user: matt tags: v1.80-refactor

04:20
Original call to close-connections! was correct check-in: 883ba16e82 user: matt tags: v1.80

Modified client.scm from [c0f004bcfc] to [a82eed2b46].

123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
			       (debug:print-info 2 *default-log-port* "connected to " (client:get-url runremote))
			       runremote)
			     (client:setup-http areapath runremote remaining-tries: (- remaining-tries 1)))
			 (begin    ;; login failed but have a server record, clean out the record and try again
			   (debug:print-info 0 *default-log-port* "client:setup, login unsuccessful, will attempt to start server ... start-res=" start-res ", server-dat=" server-dat) ;; had runid.  Fixes part of Randy;s ticket 1405717332
			   (http-transport:close-connections runremote)
			   (thread-sleep! 1)
			   (client:setup-http-baby areapath runremote remaining-tries: (- remaining-tries 1))
			   )))
		   (begin    ;; no server registered
		     ;; (server:kind-run areapath)
		     (server:start-and-wait areapath)
		     (debug:print-info 0 *default-log-port* "client:setup, no server registered, remaining-tries=" remaining-tries)
		     (thread-sleep! 1) ;; (+ 5 (random (- 20 remaining-tries))))  ;; give server a little time to start up, randomize a little to avoid start storms.
		     (client:setup-http areapath runremote remaining-tries: (- remaining-tries 1)))))







|







123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
			       (debug:print-info 2 *default-log-port* "connected to " (client:get-url runremote))
			       runremote)
			     (client:setup-http areapath runremote remaining-tries: (- remaining-tries 1)))
			 (begin    ;; login failed but have a server record, clean out the record and try again
			   (debug:print-info 0 *default-log-port* "client:setup, login unsuccessful, will attempt to start server ... start-res=" start-res ", server-dat=" server-dat) ;; had runid.  Fixes part of Randy;s ticket 1405717332
			   (http-transport:close-connections runremote)
			   (thread-sleep! 1)
			   (client:setup-http areapath runremote remaining-tries: (- remaining-tries 1))
			   )))
		   (begin    ;; no server registered
		     ;; (server:kind-run areapath)
		     (server:start-and-wait areapath)
		     (debug:print-info 0 *default-log-port* "client:setup, no server registered, remaining-tries=" remaining-tries)
		     (thread-sleep! 1) ;; (+ 5 (random (- 20 remaining-tries))))  ;; give server a little time to start up, randomize a little to avoid start storms.
		     (client:setup-http areapath runremote remaining-tries: (- remaining-tries 1)))))

Modified http-transport.scm from [7539e23e31] to [c9c181def8].

278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
                                                      (debug:print 0 *default-log-port* "WARNING: failure in with-input-from-request to " fullurl ".")
                                                      (debug:print 0 *default-log-port* " message: " msg ", exn=" exn)
                                                      (debug:print 0 *default-log-port* " cmd: " cmd " params: " params " key:" (or server-id "thekey"))
                                                      (debug:print 0 *default-log-port* " call-chain: " call-chain)))
						;; what if another thread is communicating ok? Can't happen due to mutex
						(http-transport:close-connections runremote)
						(mutex-unlock! *http-mutex*)
						(close-connection! fullurl)
						(db:obj->string #f))
					      (with-input-from-request ;; was dat
					       fullurl 
					       (list (cons 'key (or server-id   "thekey"))
						     (cons 'cmd cmd)
						     (cons 'params sparams))
					       read-string))







|







278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
                                                      (debug:print 0 *default-log-port* "WARNING: failure in with-input-from-request to " fullurl ".")
                                                      (debug:print 0 *default-log-port* " message: " msg ", exn=" exn)
                                                      (debug:print 0 *default-log-port* " cmd: " cmd " params: " params " key:" (or server-id "thekey"))
                                                      (debug:print 0 *default-log-port* " call-chain: " call-chain)))
						;; what if another thread is communicating ok? Can't happen due to mutex
						(http-transport:close-connections runremote)
						(mutex-unlock! *http-mutex*)
						;; (close-connection! fullurl)
						(db:obj->string #f))
					      (with-input-from-request ;; was dat
					       fullurl 
					       (list (cons 'key (or server-id   "thekey"))
						     (cons 'cmd cmd)
						     (cons 'params sparams))
					       read-string))