Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ApacheHttp2Transport connection did not return to the pool when it is failed

Open
#1,134 1 comment 0 reactions 1 assignee View on GitHub

@jonathanedey is already working on this.

Since Oct 1, 2025.

Assessment

This issue has not been assessed yet.

Description

Firebase Admin Java SDK v9.6.0

FirebaseOptions.Builder builder = FirebaseOptions.builder()
...
.setHttpTransport(new ApacheHttp2Transport(httpClient));
ApiFuture<BatchResponse> futures = firebaseMessaging.sendEachAsync(messages, dryRun);
BatchResponse response;
try {
      response = futures.get(TIME_OUT_MS, TimeUnit.MILLISECONDS);
 } catch (TimeoutException e) {
   ...
}
final PoolStats total = poolingAsyncClientConnectionManager.getTotalStats();
return String.format("Available=%d, leased=%d, pending=%d, max=%d",
                total.getAvailable(),
                total.getLeased(),
                total.getPending(),
                total.getMax());

Observation:
Under very busy network, FCM backend may return Unknown error while making a remote service call: Write Timeout or other errors.

Log writing (successful or failed response) become slow and slower. Afterward, all pending requests were timed out at response = futures.get(TIME_OUT_MS, TimeUnit.MILLISECONDS);

When the program just started:
Available=95, leased=5, pending=0, max=200
After some times:
Available=0, leased=0, pending=0, max=200

Update:

When using Google APIs Transports:
There is disconnect implementation in google-http-java-client

However, when using ApacheHttp2Transport:
There is no such implementation in ApacheHttp2Response
when it is disconnected, no matter the response is successfully or failed.

Dominant language
Java
Stars
620
Forks
305
Avg merge
4d 9h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from firebase/firebase-admin-java

All issues in firebase/firebase-admin-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.