121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
(define (rmt:send-receive cmd rid params #!key (attemptnum 1)) ;; start attemptnum at 1 so the modulo below works as expected
;; side-effect: clean out old connections
(when (eq? (modulo attemptnum 5) 0)
(debug:print-error 0 *default-log-port* "rmt:send-receive did not succeed after "(sub1 attemptnum)" tries. Aborting. (cmd="cmd" rid="rid" param="params)
(exit 1))
(mutex-lock! *rmt:srmutex*)
;; expire connections
(let ((expire-time (- (current-seconds) (server:get-timeout) 10))) ;; don't forget the 10 second margin
(for-each
(lambda (run-id)
(let ((connection (rmt:get-cinfo run-id)))
(if (and (vector? connection)
|
|
|
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
(define (rmt:send-receive cmd rid params #!key (attemptnum 1)) ;; start attemptnum at 1 so the modulo below works as expected
;; side-effect: clean out old connections
(when (eq? (modulo attemptnum 5) 0)
(debug:print-error 0 *default-log-port* "rmt:send-receive did not succeed after "(sub1 attemptnum)" tries. Aborting. (cmd="cmd" rid="rid" param="params)
(exit 1))
(mutex-lock! *rmt:srmutex*) ;; deadlock is here!
;; expire connections
(let ((expire-time (- (current-seconds) (server:get-timeout) 10))) ;; don't forget the 10 second margin
(for-each
(lambda (run-id)
(let ((connection (rmt:get-cinfo run-id)))
(if (and (vector? connection)
|