Skip to content

HttpRequest with 0 write timeout may make program hangs #850

@meor9zcu12

Description

@meor9zcu12

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions