dakrone / clj-http

An idiomatic clojure http client wrapping the apache client. Officially supported version.
http://clojars.org/clj-http
MIT License
1.78k stars 408 forks source link

Re-usable connection manager closes connection with keystore. #571

Open gitankitsingh opened 3 years ago

gitankitsingh commented 3 years ago
;; Having a connection manage like this 
(def cm (conn-mgr/make-reusable-conn-manager {:timeout           100
                                              :threads           10 
                                              :default-per-route 10
                                              :keystore          "keystore.jks"
                                              :keystore-pass     "pass"}))

(defn make-req []
  (for [_ (range 100)]
    (http/post url {:connection-manager cm})))

;; and a test function to make 100 requests, I observed that after each HTTP call connection is being
;; closed by the connection manager. 

On digging the logs I found that initially, it says connection can be kept alive indefinitely after each call but when a new request is made or on Connection request: older connection is closed http-outgoing-54: Close connection

Further, even if they are not closed they are not used instead new connections are established.

rymndhng commented 3 years ago

I tried this on the embedded test server and have also reproduced this.

I suspect that we're seeing the behaviour described in this upstream ticket: https://issues.apache.org/jira/browse/HTTPCLIENT-1977.