2
votes

I have a java servlet running in an app engine standard environment which is triggered periodically by a cron job. The servlet reads data from a firebase database. This servlet works fine for about a day, but then it appears that it becomes unable to connect to the firebase database. The only thing that seems to fix this is to re-deploy the servlet.

My app is very similar to the example at this link:

https://cloud.google.com/solutions/mobile/firebase-app-engine-android-studio#adding_backend_logic_using_app_engine

Has anyone else experienced this problem with firebase?

Thanks.

1

1 Answers

2
votes

This is a known problem with the Firebase java server library. The thread that manages the connection to Firebase gets killed by GAE after 24 hours. It's related to the fact that manually scaled instance jobs can only run for 24 hours, loosely documented here:

https://cloud.google.com/appengine/docs/java/an-overview-of-app-engine#scaling_types_and_instance_classes

Perhaps instead you could try Firebase in a flexible instance?

EDIT: This problem was fixed in the Firebase admin library for Java in version 4.0.4.