I have a situation where there is a Typescript/NodeJS based Cloud Function that runs a large number of Firestore database reads (about 15 million) in a short period of time (about 5 minutes). It also generates a bunch of logs (couple hundred thousand). The function is configured with a 5 minute timeout and if run normally, takes less than a minute to complete. There are cases where several hundred invocations are triggered around the same time (metrics instance count scales to about 300).
When I have the large peak of invocations I am finding that there are some executions that just stop. In the logs I can filter on one of the executions that just stop and the logs just end. There is no final message of Function execution took XXX ms, finished with status: 'ok'.
I have read through https://cloud.google.com/functions/docs/troubleshooting#unexpected-stops and have not found anything in the code that the solutions could cover.
Based on the first and last log timestamps, the function is running for about 180 seconds, which is below the 300 second timeout setting. I do not see any error messages in the logs (again, the logs just stop).
Are there any suggestions on how I can get the missing logs to figure out what is going on with my Cloud Function
Thank you.
PS: I know my function/architecture is in need of a lot of optimization, it’s on my list to fix ![]()