0
votes

I use firestore triggers to trigger a cloud function which performs a certain task when an update to a firestore document happens.

Also, I have set a max instance count to my firestore cloud function.

If high number of firestore documents get updated in a burst, the cloud function can hit the max instance limit.

In this scenario, what will happen to any subsequent triggers? Would the cloud function eventually get called when currently executing functions are completed, or is there a chance to miss the trigger for certain document updates?

1

1 Answers

1
votes

This is actually described in the Controlling Scaling Behavior documentation for Cloud Functions:

In such a scenario, Cloud Functions will attempt to serve a new inbound request for up to 30 seconds:

  • If an instance finishes processing its request during this time period, it may start to process the new inbound request.
  • If no instance becomes available, the request fails and a 429 Too Many Requests response status code is returned to the caller.