OCI Functions Timeout guide with Python SDK When Calling a Long-Running API
I'm having a hard time understanding I've tried everything I can think of but I tried several approaches but none seem to work..... I'm working with a timeout scenario when trying to invoke an OCI function that calls an external API. I'm using the Python SDK version 2.34.0, and the function is configured to have a maximum timeout of 60 seconds. However, when the external API takes longer than that, I receive the behavior: `Function invocation timed out after 60 seconds`. Here's the relevant part of my function code: ```python import oci def handler(ctx, data: str = None): # Simulate a long-running API call import requests response = requests.get('https://httpbin.org/delay/90') # This simulates a 90-second delay return response.json() ``` I've tried increasing the timeout in the OCI console settings to 120 seconds, but it doesn't seem to affect the function invocation time. Additionally, I ensured that the function's memory is set to the maximum (128 MB). I also checked the network connectivity and confirmed there's no firewall blocking the requests to the external API. Is there a way to handle this timeout more gracefully in OCI Functions? Should I consider using an asynchronous approach or possibly a different architecture? Any advice on best practices for managing long-running tasks in OCI would be greatly appreciated. For context: I'm using Python on Ubuntu 22.04. Any ideas how to fix this? I'm working in a Ubuntu 20.04 environment. I'd be grateful for any help. I recently upgraded to Python latest. What's the best practice here?