Skip to content

Fix connectionPoolingWorks test for Apache5.x by fixing setConnectionTimeToLive for Apache5.x#6165

Merged
joviegas merged 12 commits intofeature/master/apache5xfrom
joviegas/apache-5-achitecture-test-fix
Jun 11, 2025
Merged

Fix connectionPoolingWorks test for Apache5.x by fixing setConnectionTimeToLive for Apache5.x#6165
joviegas merged 12 commits intofeature/master/apache5xfrom
joviegas/apache-5-achitecture-test-fix

Conversation

@joviegas
Copy link
Copy Markdown
Contributor

@joviegas joviegas commented Jun 9, 2025

Motivation and Context

Issue

After migrating from Apache HttpClient 4.x to 5.x, connectionPoolingWorks() connection pooling tests are failing with the assertion error:

java.lang.AssertionError: 
Expecting actual:
  5
to be less than or equal to:
  2

Expected Behavior: HTTP connections should be reused from the connection pool for subsequent requests, creating only 1-2 total connections for 5 requests.

Actual Behavior: Each request creates a new connection (5 total connections), indicating that connections are not being reused despite being properly returned to the pool.

Observed Symptoms:

  • Pool correctly shows Available: 1, Leased: 0 between requests
  • Connections are marked as "can be kept alive for 60000 MILLISECONDS"
  • However, connections are immediately closed with "close connection GRACEFUL" when leased from pool
  • New connections are created for each subsequent request

Root Cause Analysis

The Core Issue: Semantic Breaking Change

Through systematic debugging, we isolated the issue to the setConnectionTimeToLive() configuration in ApacheConnectionManagerFactory.create():

// Apache 4.x PoolEntry constructor logic
if (timeToLive > 0) {
    final long deadline = this.created + timeUnit.toMillis(timeToLive);
    this.validityDeadline = deadline > 0 ? deadline : Long.MAX_VALUE;
} else {
    // timeToLive <= 0 treated as INFINITE (never expires)
    this.validityDeadline = Long.MAX_VALUE;  
}

Apache 5.x Behavior:

    timeToLive = 0: Immediate expiration (connections expire instantly)
    timeToLive > 0: Normal expiration behavior

Modifications

  • We set the setConnectionTimeToLive on Apache 5.x only if a non Zero value is set , since Apache 5.x defaults it to -1 which is Infinite value

Testing

  • Junit added back with this PR , earlier it was commented.

License

  • I confirm that this pull request can be released under the Apache 2 license

@joviegas joviegas requested a review from a team as a code owner June 9, 2025 17:47
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 9, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
65.9% Coverage on New Code (required ≥ 80%)
21.0% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

.build();
.setDnsResolver(configuration.dnsResolver);
Duration connectionTtl = standardOptions.get(SdkHttpConfigurationOption.CONNECTION_TIME_TO_LIVE);
if (!connectionTtl.isZero()) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note that SdkHttpConfigurationOption sets default value as 0 in

private static final Duration DEFAULT_CONNECTION_TIME_TO_LIVE = Duration.ZERO;

Comment on lines -157 to -161
@Override
public void connectionPoolingWorks() throws Exception {
// TODO : future PR will handle this.
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Junit added back with this PR , earlier it was commented.

Is that this test? Its being removed not added back

Copy link
Copy Markdown
Contributor Author

@joviegas joviegas Jun 10, 2025

Choose a reason for hiding this comment

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

Since Apache5HttpClientWireMockTest extends SdkHttpClientTestSuite

Its been added back , since we removed the empty test from here it will pick up the actual test from

public void connectionPoolingWorks() throws Exception {
int initialOpenedConnections = CONNECTION_COUNTER.openedConnections();
SdkHttpClientOptions httpClientOptions = new SdkHttpClientOptions();
httpClientOptions.trustAll(true);
try (SdkHttpClient client = createSdkHttpClient(httpClientOptions)) {
stubForMockRequest(200);
for (int i = 0; i < 5; i++) {
SdkHttpFullRequest req = mockSdkRequest("http://localhost:" + mockServer.port(), SdkHttpMethod.POST);
HttpExecuteResponse response =
client.prepareRequest(HttpExecuteRequest.builder()
.request(req)
.contentStreamProvider(req.contentStreamProvider().orElse(null))
.build())
.call();
response.responseBody().ifPresent(IoUtils::drainInputStream);
}
// connection pool growth strategies vary across client implementations. Some, such as the CRT grow connection counts
// by a factor of 2, while some grow strictly as requested. Mainly we want to test that it kicks in at some point and
// doesn't create a new connection for all 5 requests. This proves that while allowing variance in this behavior.
assertThat(CONNECTION_COUNTER.openedConnections()).isGreaterThanOrEqualTo(initialOpenedConnections + 1);
assertThat(CONNECTION_COUNTER.openedConnections()).isLessThanOrEqualTo(initialOpenedConnections + 2);
}
}

@joviegas joviegas merged commit e893677 into feature/master/apache5x Jun 11, 2025
21 of 22 checks passed
joviegas added a commit that referenced this pull request Jun 17, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Jul 15, 2025
* Add initial empty module for Apache5x for seting up package (#6075)

* Add initial module for Apache5x for seting up package

* Add based on new module checklist

* Baseline or Copy all the ApacheSDKHttpClient classes to newly added Apache5SDKHttpClient (#6088)

* Add initial module for Apache5x for seting up package

* Add based on new module checklist

* Baseline all the classes from Apache4 SDK client to the new Apache5 module

* Phase 2 , getting Apache 5 compilation and Junit ready along with clearing Checkstyles and spotbug issues (#6100)

* Phase 2 , getting Apache 5 compilation and Junit ready along with clearing Checkstyles and spotbug issues

* Handle comments from review

* Handle comments from Zoe

* Update the snap shot

* Fix HTTP authentication retry failures by improving RepeatableInputStreamRequestEntity repeatability (#6132)

* Fix HTTP authentication retry failures by improving RepeatableInputStreamRequestEntity repeatability

* Upated test cases

* Handled comments

* Updated snap shot after merge from master

* Revert "Updated snap shot after merge from master"

This reverts commit 64f7d33.

* Updated snap shot after merge from master

* Fix architecture test failures for apache5.x (#6140)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Updated snap shot after merge from master

* Use reference of PoolingHttpClientConnectionManager instead of HttpClientConnectionManager for Connection Manager (#6147)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix Apache5 HTTP client retry failures with non-resettable streams (#6154)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Merge PR#6165 #6165

* Disable Client based retries and define httpcore5 httpclient5 in .brazil.json (#6191)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Update snapshots

* Do not buffer the Response stream using BufferedHttpEntity (#6200)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x

* Fix compilation issues

* Fix checkstyle  issues

* Remove test which are specific to apache http

* Merge from master

* Apache5x SDkBenhmark Tests (#6206)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x

* Fix compilation issues

* Fix checkstyle  issues

* Remove test which are specific to apache http

* Add benchmark for Apache5 and add Streaming Api test cases

* Clean up unused APIs and add test to make sure it can be handled with alternatives (#6211)

* Clean up unused APIs and add test to make sure it can be handled with alternatives

* Added NTCredentials to keep backward compatibilty with Apache4.x

* Upgrade Apache5 org.apache.httpcomponents.client5 to latest available version (#6214)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x

* Fix compilation issues

* Fix checkstyle  issues

* Remove test which are specific to apache http

* Add benchmark for Apache5 and add Streaming Api test cases

* Update Apache5 to 5.5

* Preview API annotation added for Public APIs and TODOs addressed (#6215)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x

* Fix compilation issues

* Fix checkstyle  issues

* Remove test which are specific to apache http

* Add benchmark for Apache5 and add Streaming Api test cases

* Update Apache5 to 5.5

* Preview ready , addressing open TODOs

* Added PublicApi since checkstyle was failing

* Updated the snapshot

* Updated thr Brazil package nma e to have preview as suffix

* Updated Version as -PREVIEW to release apache5 as preview release (#6219)

* Updated Version as -PREVIEW

* japi cmp needs to be disables since this is a new version and we dont have old version to compare

* Handled Surface API review comments (#6224)

* Handled Surface API review comments

* Added a single test for localaddress , handled review comments

* Removing internal package name as -preview after internal discussion

* Fix transient text case failures

* update pom.xml for apache5.x

* Handled commed for merge to master PR 6220 (#6240)

* Handled Surface API review comments

* Added a single test for localaddress , handled review comments

* Removing internal package name as -preview after internal discussion

* Fix transient text case failures

* Handled comment for merge to master PR for apache 5.x

* Added change logs

* Review comment

* Handled Review comments
github-merge-queue Bot pushed a commit that referenced this pull request Jul 22, 2025
* Add initial empty module for Apache5x for seting up package (#6075)

* Add initial module for Apache5x for seting up package

* Add based on new module checklist

* Baseline or Copy all the ApacheSDKHttpClient classes to newly added Apache5SDKHttpClient (#6088)

* Add initial module for Apache5x for seting up package

* Add based on new module checklist

* Baseline all the classes from Apache4 SDK client to the new Apache5 module

* Phase 2 , getting Apache 5 compilation and Junit ready along with clearing Checkstyles and spotbug issues (#6100)

* Phase 2 , getting Apache 5 compilation and Junit ready along with clearing Checkstyles and spotbug issues

* Handle comments from review

* Handle comments from Zoe

* Update the snap shot

* Fix HTTP authentication retry failures by improving RepeatableInputStreamRequestEntity repeatability (#6132)

* Fix HTTP authentication retry failures by improving RepeatableInputStreamRequestEntity repeatability

* Upated test cases

* Handled comments

* Updated snap shot after merge from master

* Revert "Updated snap shot after merge from master"

This reverts commit 64f7d33.

* Updated snap shot after merge from master

* Fix architecture test failures for apache5.x (#6140)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Updated snap shot after merge from master

* Use reference of PoolingHttpClientConnectionManager instead of HttpClientConnectionManager for Connection Manager (#6147)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix Apache5 HTTP client retry failures with non-resettable streams (#6154)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Merge PR#6165 #6165

* Disable Client based retries and define httpcore5 httpclient5 in .brazil.json (#6191)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Update snapshots

* Do not buffer the Response stream using BufferedHttpEntity (#6200)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x

* Fix compilation issues

* Fix checkstyle  issues

* Remove test which are specific to apache http

* Merge from master

* Apache5x SDkBenhmark Tests (#6206)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x

* Fix compilation issues

* Fix checkstyle  issues

* Remove test which are specific to apache http

* Add benchmark for Apache5 and add Streaming Api test cases

* Clean up unused APIs and add test to make sure it can be handled with alternatives (#6211)

* Clean up unused APIs and add test to make sure it can be handled with alternatives

* Added NTCredentials to keep backward compatibilty with Apache4.x

* Upgrade Apache5 org.apache.httpcomponents.client5 to latest available version (#6214)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x

* Fix compilation issues

* Fix checkstyle  issues

* Remove test which are specific to apache http

* Add benchmark for Apache5 and add Streaming Api test cases

* Update Apache5 to 5.5

* Preview API annotation added for Public APIs and TODOs addressed (#6215)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x

* Fix compilation issues

* Fix checkstyle  issues

* Remove test which are specific to apache http

* Add benchmark for Apache5 and add Streaming Api test cases

* Update Apache5 to 5.5

* Preview ready , addressing open TODOs

* Added PublicApi since checkstyle was failing

* Updated the snapshot

* Updated thr Brazil package nma e to have preview as suffix

* Updated Version as -PREVIEW to release apache5 as preview release (#6219)

* Updated Version as -PREVIEW

* japi cmp needs to be disables since this is a new version and we dont have old version to compare

* Handled Surface API review comments

* Added a single test for localaddress , handled review comments

* Removing internal package name as -preview after internal discussion

* Fix transient text case failures

* Handled Surface API review comments (#6224)

* Handled Surface API review comments

* Added a single test for localaddress , handled review comments

* Removing internal package name as -preview after internal discussion

* Fix transient text case failures

* update pom.xml for apache5.x

* Handled comment for merge to master PR for apache 5.x

* Handled commed for merge to master PR 6220 (#6240)

* Handled Surface API review comments

* Added a single test for localaddress , handled review comments

* Removing internal package name as -preview after internal discussion

* Fix transient text case failures

* Handled comment for merge to master PR for apache 5.x

* Added change logs

* Add Http client bench marks with S3 Get/Put

* Removed some dependencies

* updated performance comparison logic

* updated readme

* updated warmup time and iterations

* remove performance comparison since we already have printed performamnce and one sent to cw

* Review from github

* Review comment

* updatded prints

* Handled Review comments

* Added performance comparison for Apache

* updated README

* remove preview buid

* added changed to skpi http client benchmark

* updated the snapshot version

* updated to run on jdk8

* merge from master

* updated README.md

* fixed checkbuild issues

* fixed checksyle issues

* fixed issue where secondary benchmarks were not found

* Revert "fixed issue where secondary benchmarks were not found"

This reverts commit b536571.

* Revert "fixed checksyle issues"

This reverts commit 99e697e.

* Fixed checkstyle issues

* Handled review comments

* Updated snapshot

* Add skipping of http-client-benchmarks in validate-brazil-config.yml

* updated snapshot
github-merge-queue Bot pushed a commit that referenced this pull request Aug 5, 2025
…ted code (#6312)

* Add initial empty module for Apache5x for seting up package (#6075)

* Add initial module for Apache5x for seting up package

* Add based on new module checklist

* Baseline or Copy all the ApacheSDKHttpClient classes to newly added Apache5SDKHttpClient (#6088)

* Add initial module for Apache5x for seting up package

* Add based on new module checklist

* Baseline all the classes from Apache4 SDK client to the new Apache5 module

* Phase 2 , getting Apache 5 compilation and Junit ready along with clearing Checkstyles and spotbug issues (#6100)

* Phase 2 , getting Apache 5 compilation and Junit ready along with clearing Checkstyles and spotbug issues

* Handle comments from review

* Handle comments from Zoe

* Update the snap shot

* Fix HTTP authentication retry failures by improving RepeatableInputStreamRequestEntity repeatability (#6132)

* Fix HTTP authentication retry failures by improving RepeatableInputStreamRequestEntity repeatability

* Upated test cases

* Handled comments

* Updated snap shot after merge from master

* Revert "Updated snap shot after merge from master"

This reverts commit 64f7d33.

* Updated snap shot after merge from master

* Fix architecture test failures for apache5.x (#6140)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Updated snap shot after merge from master

* Use reference of PoolingHttpClientConnectionManager instead of HttpClientConnectionManager for Connection Manager (#6147)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix Apache5 HTTP client retry failures with non-resettable streams (#6154)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Merge PR#6165 #6165

* Disable Client based retries and define httpcore5 httpclient5 in .brazil.json (#6191)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Update snapshots

* Do not buffer the Response stream using BufferedHttpEntity (#6200)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x

* Fix compilation issues

* Fix checkstyle  issues

* Remove test which are specific to apache http

* Merge from master

* Apache5x SDkBenhmark Tests (#6206)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x

* Fix compilation issues

* Fix checkstyle  issues

* Remove test which are specific to apache http

* Add benchmark for Apache5 and add Streaming Api test cases

* Clean up unused APIs and add test to make sure it can be handled with alternatives (#6211)

* Clean up unused APIs and add test to make sure it can be handled with alternatives

* Added NTCredentials to keep backward compatibilty with Apache4.x

* Upgrade Apache5 org.apache.httpcomponents.client5 to latest available version (#6214)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x

* Fix compilation issues

* Fix checkstyle  issues

* Remove test which are specific to apache http

* Add benchmark for Apache5 and add Streaming Api test cases

* Update Apache5 to 5.5

* Preview API annotation added for Public APIs and TODOs addressed (#6215)

* Fix architecture test failures for apache5.x

* Checkstyle issues

* Update to use PoolingHttpClientConnectionManager class reference that is implementation of HttpClientConnectionManager

* Fix stream reset failure in RepeatableInputStreamRequestEntity by storing content reference to avoid multiple ContentStreamProvider.newStream() calls that cause IOException when retrying requests with non-resettable streams

* writeTo_ConcurrentWrites_HandlesCorrectly no longer needed since even Apache 4.x doesnot suports this

* Fix connectionPoolingWorks by setting  skipping setConnectionTimeToLive is value is set to 0 since 0 is treated as Infinite timeToLive in Sdk and Apache 4.x but treated as immediate closeConnection in apache 5.x

* disableAutomaticRetries in Apache 5.x since SDK handles retries , also define Apache5 dependencies in .brazil.json

* Added Test case for Async , handled review ocmments

* Donot do buffer the response using BufferedHttpEntity since it might cause memory issue, this behaviour is same as Apache4.x

* Fix compilation issues

* Fix checkstyle  issues

* Remove test which are specific to apache http

* Add benchmark for Apache5 and add Streaming Api test cases

* Update Apache5 to 5.5

* Preview ready , addressing open TODOs

* Added PublicApi since checkstyle was failing

* Updated the snapshot

* Updated thr Brazil package nma e to have preview as suffix

* Updated Version as -PREVIEW to release apache5 as preview release (#6219)

* Updated Version as -PREVIEW

* japi cmp needs to be disables since this is a new version and we dont have old version to compare

* Handled Surface API review comments (#6224)

* Handled Surface API review comments

* Added a single test for localaddress , handled review comments

* Removing internal package name as -preview after internal discussion

* Fix transient text case failures

* update pom.xml for apache5.x

* Handled commed for merge to master PR 6220 (#6240)

* Handled Surface API review comments

* Added a single test for localaddress , handled review comments

* Removing internal package name as -preview after internal discussion

* Fix transient text case failures

* Handled comment for merge to master PR for apache 5.x

* Added change logs

* Review comment

* Handled Review comments

* Move connection timeout configuration from RequestConfig to ConnectionConfig in Apache HttpClient 5 (#6293)

* Replacing deprecated API like connectionTimeout on RequestConfig and passing it via defaultconnectionconfigs

* Handle review comments

* Replace httpclient.execute call with httpclient.executeOpen as mentioned in deprecation notes of httpclient.execute (#6298)

* Replacing deprecated API like connectionTimeout on RequestConfig and passing it via defaultconnectionconfigs

* Handle review comments

* replace httpclient.execute call with httpclient.executeOpen as mentioned in deprecation notes of httpclient.execute

* nit updates

* fixed sonar quebe issues

* Replace deprecated SSLConnectionSocketFactory with recommended API (#6281)

* Replace deprecated SSLConnectionSocketFactory with recommended API

* Fixed checkstyle issues

* Changed name tlsSocketStrategy on builder

* Removed warning log

* added more test cases

* updated after review

* Added ConnectionSocketFactory to Apache5Client builder same as Apache4

* handled PR comments

* Removed unused classes after moving to SSL sockets

* Added change logs

* removed old change logs

* remove unused imports

* inermittent port used in wiremock fixed

* update change logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants