Disable connection reuse only for proxy clients not for the admin client #2597
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are using WireMock for our integration tests. In one of our projects the test suite does ~ 29000 requests to the WireMock for stubbing, verifying, resetting ... requests. With the current implementation for each and every request a new TCP connection is created. This causes a lot of useless overhead. On powerful systems the test suite takes just 1 minute and a few seconds and it looks like we now reached a limit where some kind of ratelimiting (haven't yet found the reason for) on the network layer blocks the creation of new TCP connections to the WireMock. If I enable the connection reuse everything works as expected.
I just had a look through the history and it looks like disabling the connection reuse was introduced due to a bug that occurs when the WireMock server is running in proxy mode. Therefore this feature should only be disabled in these cases. (Btw. I don't think it's a good idea to mix-up the configuration of clients that are used for completely different use cases.)
To provide a test for this a added a small dummy server that just accepts a single connection. If you disable the connection reuse feature you will see it failing.
References
Submitter checklist
#help-contributing
or a project-specific channel like#wiremock-java