@@ -236,32 +236,32 @@ ;; (condition-case (with-input-from-request "http://localhost"; #f read-lines) ;; ((exn http client-error) e (print e))) (set! res (vector success (db:string->obj - ;; handle-exceptions - ;; exn - ;; (begin - ;; (set! success #f) - ;; (debug:print 0 *default-log-port* "WARNING: failure in with-input-from-request to " fullurl ".") - ;; (debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn)) - ;; (if *runremote* - ;; (remote-conndat-set! *runremote* #f)) - ;; ;; Killing associated server to allow clean retry.") - ;; ;; (tasks:kill-server-run-id run-id) ;; better to kill the server in the logic that called this routine? - ;; (mutex-unlock! *http-mutex*) - ;; ;;; (signal (make-composite-condition - ;; ;;; (make-property-condition 'commfail 'message "failed to connect to server"))) - ;; ;;; "communications failed" - ;; (db:obj->string #f)) + (handle-exceptions + exn + (begin + (set! success #f) + (debug:print 0 *default-log-port* "WARNING: failure in with-input-from-request to " fullurl ".") + (debug:print 0 *default-log-port* " message: " ((condition-property-accessor 'exn 'message) exn)) + (if *runremote* + (remote-conndat-set! *runremote* #f)) + ;; Killing associated server to allow clean retry.") + ;; (tasks:kill-server-run-id run-id) ;; better to kill the server in the logic that called this routine? + (mutex-unlock! *http-mutex*) + ;;; (signal (make-composite-condition + ;;; (make-property-condition 'commfail 'message "failed to connect to server"))) + ;;; "communications failed" + (db:obj->string #f)) (with-input-from-request ;; was dat fullurl (list (cons 'key "thekey") (cons 'cmd cmd) (cons 'params sparams)) read-string) - transport: 'http) + transport: 'http)) 0)) ;; added this speculatively ;; Shouldn't this be a call to the managed call-all-connections stuff above? (close-all-connections!) (mutex-unlock! *http-mutex*) )) @@ -485,17 +485,15 @@ ;; (thread-sleep! 4))) ;; fallback for if the math is changed ... (define (http-transport:server-shutdown server-id port) (let ((tdbdat (tasks:open-db))) (debug:print-info 0 *default-log-port* "Starting to shutdown the server.") - ;; need to delete only *my* server entry (future use) - ;; (if *dbstruct-db* (db:sync-touched *dbstruct-db* *run-id* force-sync: #t)) ;; handled in the watchdog only - (set! *time-to-exit* #t) ;; tell on-exit to be fast as we've already cleaned up ;; ;; start_shutdown ;; (tasks:server-set-state! (db:delay-if-busy tdbdat) server-id "shutting-down") + (set! *time-to-exit* #t) ;; tell on-exit to be fast as we've already cleaned up (portlogger:open-run-close portlogger:set-port port "released") (thread-sleep! 5) (debug:print-info 0 *default-log-port* "Max cached queries was " *max-cache-size*) (debug:print-info 0 *default-log-port* "Number of cached writes " *number-of-writes*) (debug:print-info 0 *default-log-port* "Average cached write time "