Skip to content

Allow configuring http connection pool size#1474

Merged
bsideup merged 1 commit intodocker-java:configurable_pool_sizefrom
kdvolder:connection-pool
Nov 20, 2020
Merged

Allow configuring http connection pool size#1474
bsideup merged 1 commit intodocker-java:configurable_pool_sizefrom
kdvolder:connection-pool

Conversation

@kdvolder
Copy link
Copy Markdown
Contributor

Adresses #1466

Copy link
Copy Markdown
Member

@bsideup bsideup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

Before accepted, this change could use some tests :)

@bsideup bsideup added this to the next milestone Oct 24, 2020
@kdvolder
Copy link
Copy Markdown
Contributor Author

Before accepted, this change could use some tests :)

Sure! But I'm not seeing a 'src/test' folder in either of the projects that I made changes to. So I'm not really sure where tests for these projects supposed to live.

So please provide some guidance. E.g. where should I place a test, and how do you run them typically (so I can give em trial run before committing / pushing).

Thanks for your help!

@bsideup
Copy link
Copy Markdown
Member

bsideup commented Oct 26, 2020

@kdvolder all legacy tests are in docker-java/src/test/main but it would be better to put this one into module's test sources. Please let me know if you feel that you need help with that - I can take over the PR and assist you

@kdvolder
Copy link
Copy Markdown
Contributor Author

For the time being I'm making small commits for addressing individual comments. Once the PR is 'acceptable' and ready to merge I can rebase and squash into a single commit... or not... depending on what you prefer.

@kdvolder
Copy link
Copy Markdown
Contributor Author

kdvolder commented Oct 26, 2020

I'm looking at adding a test or two but I'm not really sure how to do it, or even what kind of test to add.

I think it would make sense to add a basic test that checks that:

  • if you create a zerodep/appache http client instance with a custom 'ConnectionPoolConfig'
  • then you get a client that has the expected connection pool manager setup (i.e a org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.PoolingHttpClientConnectionManager instance with the right characteristics.

Problem that I am having is that the apis are not really letting me access internal details such as PoolingHttpClientConnectionManager. So the test can't get access to this instance to check it is setup as expected.

I could try adding more methods to the api so as to expose more of the internals. But probably you wouldn't like it, because the feel I get from the api is that it is deliberately trying to not expose this sort of information.

So if you'd like me write some tests, which I'm happy to do, I'm going to need some concrete suggestions on what exactly to do.

Not sure if guiding me through this may actually be more work for you then writing a simple test case yourself.

I'd be happy for your guidance but if you rather take it from here and write the test yourself, I'm fine with that as well. Whatever is more convenient to you.

kdvolder added a commit to spring-projects/spring-tools that referenced this pull request Oct 29, 2020
- supports connection pool config

See: docker-java/docker-java#1474
@kdvolder
Copy link
Copy Markdown
Contributor Author

@bsideup I think I have addressed all comments except for adding tests.

I don't know what to do about the tests and will leave that in your capable hands as you have so kindly offered:

Please let me know if you feel that you need help with that - I can take over the PR and assist you

In the mean time I have already built jars for our use from the forked repo, and we have adopted the use of those jars for the time being. As far as I am concerned that resolves the issue on our end. Though I would really prefer if this could be merged into master so we do not depend on a custom forked build. If you want me to add tests, I am happy to do so, but I can't do it without your help.

@kdvolder
Copy link
Copy Markdown
Contributor Author

Squashed into a single commit

@bsideup bsideup changed the base branch from master to configurable_pool_size November 20, 2020 14:27
@bsideup bsideup merged commit 361d39e into docker-java:configurable_pool_size Nov 20, 2020
@bsideup
Copy link
Copy Markdown
Member

bsideup commented Nov 20, 2020

@kdvolder I just merged your PR into a branch and will take it from there. Thanks for working on it 👍

@kdvolder
Copy link
Copy Markdown
Contributor Author

@bsideup Thanks for taking care of the test case and final polishes.

@kdvolder kdvolder deleted the connection-pool branch November 20, 2020 17:22
bsideup added a commit that referenced this pull request Nov 20, 2020
* Allow configuring http connection pool size (#1474)

See: #1466

* Add a test, set default to max

* remove unused class

Co-authored-by: Kris De Volder <kdevolder@pivotal.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants