clj-http icon indicating copy to clipboard operation
clj-http copied to clipboard

Re-usable connection manager closes connection with keystore.

Open gitankitsingh opened this issue 5 years ago • 1 comments

;; 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.

gitankitsingh avatar Nov 03 '20 20:11 gitankitsingh

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.

rymndhng avatar Nov 16 '20 01:11 rymndhng