Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reusing active connection #2114

Closed
mj11pyqe opened this issue Sep 1, 2022 · 7 comments
Closed

Reusing active connection #2114

mj11pyqe opened this issue Sep 1, 2022 · 7 comments

Comments

@mj11pyqe
Copy link

mj11pyqe commented Sep 1, 2022

my feature

Feature: dummy
  Background:
   # generated trhgouht crudcrud.com
    * url "https://crudcrud.com/api/e7f976db29bc4e26a700d28a629edd56"

  Scenario:
  * method GET
  * method POST
  * method DELETE

my karate-config
fucntion fn() { karate.configure('readTimeout', 30000);}

and my karate.log

The logs show that a tls handhsake is performed for each request. Have also debugged it with wireshark and can confirm it.
The log also show tht socket timeout is set to 0 after a request is handled

Once a connection is established, requests should reuse the same session, this implicates handshake is not repeated

Stack overflow question https://stackoverflow.com/questions/73568779/connnections-handling/73569628#73569628

@ptrthomas
Copy link
Member

we would prefer you follow the process exactly as described: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue

I don't consider this a priority just yet as no one else has reported this, and this is possibly a non-issue for internal / pre-prod tests. tagging as help wanted

@mj11pyqe
Copy link
Author

How to pull request?

@ptrthomas
Copy link
Member

closing this as wontfix and we will insist on a way to replicate in the future

@joelpramos
Copy link
Contributor

Just dumping thoughts here as it might be related to something I was looking into. Have a team getting some socket timeouts in a huge pipeline (inconsistently and based on timing <5ms probably on handshake or even the client side) and I was wondering about this Http Client configuration. Reading through the previous Apache lib they used to have a multi thread connection mgr. I think the newer version (currently in use) must have something of that nature and some tweaks in the current client might be needed.

For now consider me just as an observer of this thread although I might play around that area of the code based on my availability. Regardless it's probably too sensitive to try to put into 1.3.0 if intention is to release in the next couple weeks.

https://stackoverflow.com/questions/35939602/apache-httpclient-and-httpconnection-in-a-multithreaded-applicatio
https://cwiki.apache.org/confluence/display/HTTPCOMPONENTS/ClientConnectionManagementDesign#ClientConnectionManagementDesign-UsagePatterns

@ptrthomas
Copy link
Member

@mj11pyqe can you see if this commit makes a difference ? 1e7db1f

@mj11pyqe
Copy link
Author

@ptrthomas A new connection is now opeened and closed for each request. After some testing, I still received timeout issues.
Also, tests I made took 10 mintues with reusing same connections, but took 14 minutes otherwise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants