Back

function execution timeout

  • 11
  • Functions
  • Cloud
erikkamalov
2 Feb, 2024, 08:05

we are still struggling with the timeout issue when executing the function. I just migrated from self-host to appwrite cloud. but I still face a problem, 1-2 out of 10 requests are falling.

we need to check the logs and fix the problem.

failed function id: 65bca0e9badb30f85e9d project id: 65bc9440a1dc894315ea

TL;DR
Developers are working on fixing function execution timeout issues. The fix will be released in version 1.5.7. A temporary solution has been implemented in Cloud and will be extended to self-hosted. Further improvements and adjustments are being made to prevent timeouts and freezes. A permanent fix is in the works, with plans to deploy on Cloud first. The detailed technical process can be found in the provided PR link. Benchmark results show better concurrency, but the function timeout issue is still being investigated, with a suspected bug in Node 18. Additional infrastructure changes are being considered to enhance performance.
erikkamalov
2 Feb, 2024, 08:06

@Core who can check the logs?

erikkamalov
2 Feb, 2024, 18:21

Let me test the local one right now.

Jake
3 Feb, 2024, 03:37

Are you able to share the full schema of your relationships? So far I see you have:

branches <-> organization branches <-> receipts branches -> pos_config branches -> address receipts <-> transactions receipts -> pos_system

erikkamalov
3 Feb, 2024, 03:41

Yesterday I created a demo project with exact copies. I can invite you there if you give me your email.

erikkamalov
3 Feb, 2024, 03:44

@Jake

erikkamalov
3 Feb, 2024, 03:52

wow i can't only one member

erikkamalov
3 Feb, 2024, 03:52

i will send personal message

erikkamalov
3 Feb, 2024, 03:53

@Jake

erikkamalov
3 Feb, 2024, 03:58

I would be very glad if you would help

Jake
3 Feb, 2024, 04:31

Could you please add me to the repo with the function code? https://github.com/abnegate

Jake
3 Feb, 2024, 04:34

Or just share the full code over DM if it's easier

erikkamalov
3 Feb, 2024, 04:37

i send invite

erikkamalov
3 Feb, 2024, 04:39

@Jake I can invite you to join the appwrite which is self-hosting installed.

erikkamalov
3 Feb, 2024, 04:39

there is more error observed there

erikkamalov
3 Feb, 2024, 04:39

pls send me your email

erikkamalov
3 Feb, 2024, 04:43
erikkamalov
3 Feb, 2024, 04:47

sometimes the timeout occurs after several requests, sometimes after a lot of requests. I assume that the branch model is cached and the request responds quickly. but at some point getdocument(branch) freezes.

erikkamalov
3 Feb, 2024, 04:48

can relationship queries turn into recursion?

erikkamalov
3 Feb, 2024, 04:50

Two-way relationship could it be a source of recursion?

Jake
3 Feb, 2024, 04:53

Yeah, internally the relationships are fetched recursively, but there's a max of 3 levels of recursion, which is why on the third level you get null for any further relationships.

We also detect cyclic relationships across collections and short-circuit them so they're only fetched once to avoid an infinite loop.

Fetching from any of the collections via console, client and server SDKs are all working okay, so I would rule out a relationship bug.

Tried the same code with a PHP function instead and got the same issue so it's not node specific, seems to me to be function related. Back to you @Meldiron πŸ˜…

erikkamalov
3 Feb, 2024, 04:56

did you manage to get a timeout problem too?

Jake
3 Feb, 2024, 04:57

Yeah I did, but only in functions. Manually using console and SDKs worked okay. Tried the same code in a PHP function and got the same issue so it's not runtime specific either

erikkamalov
3 Feb, 2024, 05:00

do you have any suggestions or ideas to solve the problem? we are a startup and should have launched 2 weeks ago, but because of this problem we are standing still.

https://business.pai.kg

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