9.0.0 to 9.3.0 sendMulticastAsync vs sendEachForMulticastAsync. Server crashes when sending too many pushes

Open
#1,001 4 comments 0 reactions 1 assignee View on GitHub

@Doris-Ge is already working on this.

Since Oct 8, 2024.

Assessment

This issue has not been assessed yet.

Description

api: messaging
[REQUIRED] Step 2: Describe your environment
  • Operating System version: debian / grails / groovy / java 11
  • Firebase SDK version: 9.3.0
  • Library version: _____
  • Firebase Product: admin
[REQUIRED] Step 3: Describe the problem

We switched out the firebase admin version from 9.0.0 to 9.3.0 yesterday. Sending out a few pushes works fine, but we sometimes send out a few millions in a "batch". There never were issues with the old sendMulticastAsync

    ApiFuture<BatchResponse> apiFuture = FirebaseMessaging.getInstance().sendEachForMulticastAsync(multicastMessage)

    apiFuture.addListener({
        def batchResponse = apiFuture.get()
        if (batchResponse != null && batchResponse.failureCount > 0) {
            for (int i = 0; i < batchResponse.responses.size(); i++) {
                def response = batchResponse.responses.get(i)
                if (response != null && !response.successful && response.exception != null && (
                        (ErrorCode.NOT_FOUND == response.exception.errorCode && MessagingErrorCode.UNREGISTERED == response.exception.messagingErrorCode) ||
                                (ErrorCode.INVALID_ARGUMENT == response.exception.errorCode && MessagingErrorCode.INVALID_ARGUMENT == response.exception.messagingErrorCode))) {
                    UidRemovalJob.removalCandidates.add(new UidRemovalCandidate(phoneId: tokenList[i], os: 2))
                }
            }
        }
    }, executorServiceAndroidResponses)

Does this need to be switched to another implementation?

Dominant language
Java
Stars
620
Forks
305
Avg merge
3h 23m
Merged PRs (30d)
1

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.