Back

Unpredictable Function Timeouts

  • 0
  • Functions
amitrochates
25 Mar, 2025, 03:42

Error: Synchronous function execution timed out. Use asynchronous execution instead, or ensure the execution duration doesn't exceed 30 seconds. Error Code: 408

I have a simple function (call it: abc) which returns some attribute from a collection bty taking another as input. ABC is polled by a cron that runs every minute in dev and every hour when idle (usually hits function ABC 15-25 times in a go whenever it runs.

ABC is also polled at times from frontend, about 20 times with interval of 6 secs during some operations.

The current timeout of this is 30 s. The execution of this function sometimes randomly times out.

From my logic it's neither that computationally heavy (since it just returns a simple attribute) nor is the polling frequency that high currently. What could be the issue and how to make the timeout more predictable.

TL;DR
Issue: Unpredictable timeouts for function 'abc' despite low computation and polling frequency. Solution: Adjust function to use asynchronous execution to prevent timeouts. Check for any potential bottlenecks in the code causing delays.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more