Skip to content

chore(deps): Bump org.apache.httpcomponents.client5:httpclient5 - #1239

Merged
lahirumaramba merged 4 commits into
mainfrom
fix-httpclient5-bump
Sep 17, 2026
Merged

lahirumaramba merged 4 commits into
mainfrom
fix-httpclient5-bump

Conversation

@lahirumaramba

@lahirumaramba lahirumaramba commented Sep 15, 2026

Copy link
Copy Markdown
Member

Fixes the CI build failure in #1238 when bumping org.apache.httpcomponents.client5:httpclient5 from 5.3.1 to 5.6.3.

  1. Enforce Read Timeout in ApacheHttp2Request:

    • Issue: Starting in HttpClient 5.4+, InternalHttpAsyncExecRuntime no longer sets socket-level timeouts on the endpoint when the protocol is HTTP/2 (version >= HTTP_2) because multiple multiplexed streams share a single connection. Consequently, HTTP/2 requests in ApacheHttp2Request were waiting indefinitely on responseFuture.get(), causing read timeout tests (ApacheHttp2TransportIT.testReadTimeoutAuthorizedGet and testReadTimeoutAuthorizedPost) to fail.
    • Fix: Stored the configured readTimeout in ApacheHttp2Request and applied it to responseFuture.get(readTimeout, TimeUnit.MILLISECONDS). On timeout, the future is cancelled (responseFuture.cancel(true) sends an HTTP/2 stream reset) and an IOException("Stream exception in request") is thrown to maintain backward compatibility with SDK error contracts. Added a unit test testReadTimeout in ApacheHttp2TransportTest.
  2. Update Test HttpServer Initialization in ApacheHttp2TransportTest:

    • Issue: HttpCore 5.4.3 introduced a new mandatory parameter (HttpConnectionFactory) to the low-level HttpServer constructor, causing a compile failure in FakeServer.
    • Fix: Migrated FakeServer to construct the server using ServerBootstrap.bootstrap().

dependabot Bot and others added 2 commits September 15, 2026 21:09
Bumps [org.apache.httpcomponents.client5:httpclient5](https://github.com/apache/httpcomponents-client) from 5.3.1 to 5.6.3.
- [Changelog](https://github.com/apache/httpcomponents-client/blob/rel/v5.6.3/RELEASE_NOTES.txt)
- [Commits](apache/httpcomponents-client@rel/v5.3.1...rel/v5.6.3)

---
updated-dependencies:
- dependency-name: org.apache.httpcomponents.client5:httpclient5
  dependency-version: 5.6.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@lahirumaramba
lahirumaramba requested review from a team and jonathanedey September 15, 2026 22:40
@lahirumaramba lahirumaramba added the release:stage Stage a release candidate label Sep 15, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates the httpclient5 dependency from version 5.3.1 to 5.6.3 in pom.xml. Consequently, the test server initialization in ApacheHttp2TransportTest.java has been refactored to use ServerBootstrap instead of the direct HttpServer constructor. The feedback suggests simplifying the anonymous HttpProcessor implementation in the test setup by using HttpProcessorBuilder to reduce boilerplate code.

Comment thread src/test/java/com/google/firebase/internal/ApacheHttp2TransportTest.java Outdated
@lahirumaramba lahirumaramba changed the title Fix httpclient5 bump chore(deps): Bump org.apache.httpcomponents.client5:httpclient5 Sep 15, 2026
@lahirumaramba

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request upgrades the httpclient5 dependency to version 5.6.3 and implements read timeout handling in ApacheHttp2Request by tracking the timeout value and applying it to the responseFuture.get() call. It also adds a corresponding unit test to verify the timeout behavior and refactors the FakeServer test helper to use ServerBootstrap. There are no review comments, and I have no feedback to provide.

@jonathanedey jonathanedey left a comment

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.

LGTM with one nit, Thanks!

throw new IOException("Request Cancelled", e);
} catch (TimeoutException e) {
responseFuture.cancel(true);
throw new IOException("Stream exception in request", e);

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.

Should we specify that it was a read timeout here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah good call! I thought about it but I wonder if that would break the backward compatibility in some way... even if it did, it would most likely be a minor risk I think

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let's leave it like this for now because our priority is to get the dependency bumped. We can address that in a future PR.

@lahirumaramba
lahirumaramba merged commit 5b75c5c into main Sep 17, 2026
17 of 20 checks passed
@lahirumaramba
lahirumaramba deleted the fix-httpclient5-bump branch September 17, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:stage Stage a release candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants