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

Getting Invalid use of BasicClientConnManager: in parallel environment #37

Closed
kushalpal17 opened this issue Jan 7, 2020 · 4 comments
Closed
Labels
Milestone

Comments

@kushalpal17
Copy link

kushalpal17 commented Jan 7, 2020

mvn gauge:execute -DspecsDir="specs/" -DinParallel=true -Dnodes=4


java.lang.IllegalStateException: Invalid use of BasicClientConnManager: connection still allocated.
Make sure to release the connection before allocating another one.
@dzieciou
Copy link
Owner

Thanks for reporting the problem.

  1. Does the problem occur if you don't use curl logger? If so, it might be related to how RestAssured uses Apache HTTP Client.
  2. If no, can you provide me minimal working example so I can reproduce the case? Especially what's your Maven configuration (pom.xml) and what's inside of specs/?

@dzieciou dzieciou added the bug label Jul 25, 2020
@francislainy
Copy link

I happened to get this same error too and I think it happened when I had two sequential calls for RestAssured, one with a post and the other with a delete but still using the same request specification object.

If I get this error again I'll try and come back here to update this comment with a sample.

@dzieciou dzieciou added this to the 2.0.0 milestone Oct 18, 2020
@dzieciou
Copy link
Owner

dzieciou commented Oct 18, 2020

I was able to reproduce the bug following instructions from @francislainy . This seems to be a bug in REST-assured that I reported there: rest-assured/rest-assured#1392. REST-assured is not releasing HTTP connections when reusing HTTP client instance.

A workaround would be to remove reuseHttpClientInstance() in CurlRestAssuredConfigFactory, but I would prefer this to be fixed in REST-assured. There are reasons to reuse HTTP client instance across multiple requests, namely, performance reasons. You don't want to introduce additional overhead.

@dzieciou
Copy link
Owner

dzieciou commented Nov 2, 2020

I decided to not reuse HTTP client. Hope this will fix the issue.

@dzieciou dzieciou closed this as completed Nov 2, 2020
dzieciou added a commit that referenced this issue Nov 2, 2020
* Do not reuse HTTP client instance (bug fix for #37)

* Update README and pom.xml

* Update README and pom.xml
@dzieciou dzieciou reopened this May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants