-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Bug Report: maintenance task must not kill executions that have not reached the timeout defined in the function #5233
Comments
the findings were recorded in this discord conversation https://discord.com/channels/564160730845151244/1078437335844266085/1085587879817924768 |
@rafagazani, thanks for creating this issue! 馃檹馃徏 To provide some more context: When a function executes, a runtime container is created (if one does not exist already) to execute your function code. To save resources, Appwrite has a maintenance task that runs every 30 minutes to remove "inactive" runtime containers: Lines 738 to 758 in e8c74d7
An "inactive" runtime container is one that has not completed successfully in the last So, if you have a long-running function, there is a higher chance it may be processing while the maintenance task runs, and because it hasn't finished successfully, it can be removed by Appwrite leading to an error like:
Let me talk to the team about this. |
We noticed a race condition in Appwrite Cloud caused most likely by the same problem. PR: https://github.com/open-runtimes/executor/pull/24/files |
@Meldiron Hi, the changes that you mentioned above will solve the issue of that curl error in version 0.15.3 if i make this change to src files? As most of my fucntions runs within 1 seconds. |
Hi @garvitomer 馃憢 This issue is regarding long-running functions, so I don't think it's related to your issue. Could you please elaborate on your issue? Are you also getting |
@Meldiron We discussed it on discord server. This is the github issue: Discord link: |
@Meldiron This is the error which I get in general. There is no set pattern I can find whoch cause this error. I restart docker everyday to minimize the error, as it generally starts happening from day2.
|
@garvitomer As I reported there on discord, there was a lot of this type of random error when my server was in the account, I don't know why but when changing servers I didn't come across this error anymore |
@rafagazani Hi, please track it and inform us about your result after 4-5 days as errors starts usually after 24-48 hours and not every function gets impacted by it. I personally don't think it is due to server but if that is the case I will change it too from to hetzner to some other provider. Which one are you using now? |
@garvitomer I've been watching since the 15th at 00:26. It has passed 197k executions, zero errors. I believe that this process goes on for a few more days, it should go up to 650 thousand executions. I'm using digital ocean. |
This issue is not related to long-running functions, as it can occur even if your function's running time is less than 1 s. Everyone who uses appwrite function could face this issue. Take a look at this line, which only runs at the end of the appwrite function execution flow:
If a maintenance task is executed between the start of the appwrite function execution flow and the execution of
|
Hi, I stopped using appwrite 6 months back due to this issue and learned Golang and currently building server in it all due to this single major issue. Now I think it is best way to do whatever you want and with complete freedom. Though appwrite community helped me a lot to understand basics of api and I will always be grateful to them. |
I got around this problem using these tips:
I'm waiting for version 1.4.0, I believe it will resolve the issue. I also thank the appwrite core and its community for the project and support. |
馃憻 Reproduction steps
Create a functions with a timeout greater than 30 seconds.
Make the execution run until close to the defined timeout.
馃憤 Expected behavior
that the execution is waited until the defined timeout
馃憥 Actual Behavior
If the run is active for more than 30 seconds when starting the maintenance task, it will kill the run.
馃幉 Appwrite version
Version 1.1.x
馃捇 Operating system
Linux
馃П Your Environment
python appwrite==1.1.0
馃憖 Have you spent some time to check if this issue has been raised before?
馃彚 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: