Python code in my Cloud Function (2nd generation) runs for 45minutes. Cloud Scheduler job triggers this CF. Code completes successfully but Cloud Scheduler job fails as the runtime is beyond 30min. Any solution or workaround for this error?
I tried using eventarc trigger for cloud function but the timeout is 9 minutes and the code stops running after 9 minutes without throwing any error on the Cloud Scheduler job. HTTPs trigger works well for my code but the scheduler job throws an error in the end.
All the serverless products, including Cloud Task (with HTTP, not App Engine endpoint) have a maximum of 30 minutes time out by waiting a HTTP response. It should be something by default on the Google (Cloud?) infrastructure.
So, you can't use ONLY Cloud Scheduler. My preferred pattern for that is to use Cloud Run Jobs + Cloud Workflows trigger by Cloud Scheduler.
Or, you can simply ignore the Cloud Scheduler timeout and rely on monitoring/logging to track the errors