firebase-admin-java icon indicating copy to clipboard operation
firebase-admin-java copied to clipboard

HttpRequest with 0 write timeout may make program hangs

Open meor9zcu12 opened this issue 1 year ago • 4 comments

Firebase Admin Java SDK: v9.2.0

Problem encountered:

When under high traffic, FCM admin SDK will throw some errors like:

Error 1. com.google.firebase.messaging.FirebaseMessagingException: Unexpected HTTP response with status: 408

Error 2. com.google.firebase.messaging.FirebaseMessagingException: Unknown error while making a remote service call: Unexpected end of file from server

Error 3. com.google.firebase.messaging.FirebaseMessagingException: Unknown error while making a remote service call: Connection timed out (Connection timed out)

At the same time, after throwing these errors, FCM admin SDK may still make java program never stop because of FCM admin SDK still waiting response from fcm.googleapis.com

Findings:

FCM admin uses com.google.http-client, which writeTimeout = 0 by default, link

I can't find how ErrorHandlingHttpClient to set writeTimeout, it may be one of result that make program keep waiting response from fcm.googleapis.com under high traffic.

meor9zcu12 avatar Aug 07 '23 09:08 meor9zcu12

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Aug 07 '23 09:08 google-oss-bot

I think we also ran into this Issue. Are there any news on this topic?

TheRittler avatar Jan 10 '24 10:01 TheRittler

Sorry for the delay in reply. We are currently investigating this issue. Will update here later.

chong-shao avatar Jan 30 '24 21:01 chong-shao

Any updates here?

GarreltMock avatar Mar 21 '24 13:03 GarreltMock