Closed maharavindran closed 2 months ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
we could see message Timed out while making an API call: Read timed out errors while printing exception messages in case of null.
Hi maharavindran,
Could you provide a full stack trace for failure cases mentioned above? Additionally, please try sending a smaller batch of device tokens, perhaps 100 per request.
@Doris-Ge we did increase our read and connect timeouts to 30 seconds with 500 device tokens , failures drastically reduced . But here is the stack trace for few of the failures during burst traffic , "Timed out while making an API call: Connect timed out" " Unexpected HTTP response with status: 401" " Unknown error while making a remote service call: Remote host terminated the handshake" "Request contains an invalid argument" "Cannot invoke "com.google.firebase.IncomingHttpResponse.getStatusCode()" because the return value of "com.google.firebase.messaging.FirebaseMessagingException.getHttpResponse()" is null" most of the time its the timed out message during burst traffic
Thanks @maharavindran!
I'm glad to hear that increasing timeouts helped reduce the failures! Sending to a large batch of device tokens can be slow because sendEachForMultiCast
sends an HTTP request for each device token. If you send to 500 tokens, the sendEachForMultiCast
function call will have to wait for 500 HTTP requests to complete before it returns.
You can also consider other options to mitigate this:
sendEachForMultiCast
with HTTP/2 clients.
After moving to fcm 9.2.0 we are using sendEachForMultiCast while we send 500 device tokens per request , where we are facing issues with null error code for failure cases .(com.google.firebase.messaging.FirebaseMessagingException.getMessagingErrorCode() is null)