Skip to content

useSystemProperties breaks custom connection pooling #13

@anowell

Description

@anowell

In this builder chain, the call to useSystemProperties() effectively results in ignoring the values set by setMaxConnTotal(maxConnections) and setMaxConnPerRoute(maxConnections). And this isn't order-dependent, because the actual properties used by the underlying client are determined during the call to build with this code in the upstream Apache client

So I see basically 3 choices:

  1. Stop calling useSystemProperties(). This will require figuring out how to go back and add proxy support that motivated useSystemProperties.

  2. Explicitly call System.setProperty("http.keepAlive", "true") and System.setProperty("http.maxConnections", maxConnections) before building the client. (Somebody with a bit more java mastery wanna weigh in on the side affects of setting properties like this? Any risks to creating multiple AlgorithmiClient instances with different connection pooling?). This also means that we have to accept that maxConnTotal is always 2x the maxConnPerRoute.

  3. PR to try and convince upstream to replace that block with one where it only uses the system properties for those values if they weren't explicitly set. (I presume we could use the 2nd option in the meantime of waiting for such a PR to land.)

Wanna weigh in @kennydaniel, since I believe you green-lighted the useSystemProperties change?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions