GCP Cloud Functions timeout when invoking Pub/Sub with Node.js 14 runtime
I'm running into a timeout scenario with my Google Cloud Function that's supposed to process messages from a Pub/Sub topic. I'm using the Node.js 14 runtime, and the function is configured to handle messages asynchronously. However, after 60 seconds, I'm getting a timeout behavior: `behavior: Function execution took too long. Timeout: 60s`. My function is set to handle messages like this: ```javascript const { PubSub } = require('@google-cloud/pubsub'); exports.processPubSubMessage = async (message, context) => { const data = Buffer.from(message.data, 'base64').toString(); console.log(`Processing message: ${data}`); // Simulate some asynchronous work await new Promise(resolve => setTimeout(resolve, 70000)); // intentionally long console.log('Message processed successfully'); }; ``` I tried increasing the timeout setting in the Google Cloud Console to 120 seconds, but it doesn't seem to have any effect. Additionally, I verified that the function is triggered correctly by the Pub/Sub topic, as I can see the logs for the incoming messages. I've also checked that the Pub/Sub message acknowledgment is handled correctly, ensuring that the message isn't acknowledged until after processing is complete. However, it seems like the timeout is based on the function's execution time rather than the handling of the message itself. Does anyone have insights on how to properly handle long-running tasks in Cloud Functions? Is there a recommended approach or best practice for processing Pub/Sub messages that might take longer than the default timeout? Any help would be appreciated!