CodexBloom - Programming Q&A Platform

OCI Functions Timing Out When Invoked from OCI Events - Need guide with Configuration

πŸ‘€ Views: 22 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-09
oracle-cloud-infrastructure functions events Python

I'm working through a tutorial and I'm working with a timeout scenario when invoking my OCI Functions using OCI Events. I've set up a trigger that should call my function whenever a new object is created in an OCI Object Storage bucket. However, I'm getting the following behavior message in the log: `Function execution timed out after 30 seconds`. I've confirmed that my function does take some time to process the object, but it should be able to complete within a reasonable timeframe. Here’s a snippet of my function code in Python using the `oci` library: ```python import oci def handler(ctx, data: str = None): # Simulate processing time import time time.sleep(35) # Simulating a long processing task print("Processing complete") ``` I've checked the function configuration and it currently has a timeout set to 60 seconds. This was meant to give it enough time to process the incoming event, yet it seems that the invocation through OCI Events is enforcing its own timeout. I also verified that the trigger is correctly configured to call the function with the right parameters. Here are the settings I used: - **Function Timeout:** 60 seconds - **Event Source:** Object Storage - **Trigger Type:** Create Object I've tried increasing the timeout setting for the function, but I'm concerned there might be a limitation or some best practice that I'm missing when it comes to invoking functions from events. Are there additional configurations or best practices I should consider to avoid this timeout scenario? Any insights or suggestions would be greatly appreciated! Thanks for taking the time to read this!