-
Notifications
You must be signed in to change notification settings - Fork 0
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Long running tasks #32
Comments
After running each simple task or a task with bulk arguments we check the duration and exit the process, so there's no need to define a duration for each task or bulk argument. The problem is that when the execution time outs, the bulk arguments and the task itself stays marked as running. Solution 1: Solution 2: In the case we want to track the time the task has been changed by admin as the "last modified time", we can hold the info in the same table. In the case we want to track the time that is related to the execution and is not related to the task itself, then we should log it. |
@zzhovo what will happen if execution of a bulk task takes more than allowed max execution time? I think it goes to 'running' state waits for next execution request, so, even if you will schedule a new task with higher priority, it still will execute the 'running' one, right ? |
@arsendovlatyan when a task takes more than allowed execution time the request ends with fatal error, and the status of that task stays "running". The next cycle starts running the other tasks with status "registered" or "in progress" and doesn't do anything with the "running" tasks, because they are not "running" but "failed". So what I suggest is not creating a separate task to fix the running tasks, but just mark them as "failed" before starting to execute the other tasks. |
During our discussion today with @eriktad and @armdev17 we decided:
However, I think the condition Our target with this change is to keep tasks If so, we can remove I think in our case and for advance users second option (using BTM's one) is good, for others, we can recommend cron interval, execution time and PHP max execution time to much each other, usually, PHP max execution time is 30 seconds (in our case it's 600 or so), so, if someone will set BTM execution time below PHP max exec. time, we can give them a warning saying something like "tasks can be interrupted before PHP max execution time will be passed", we don't need to do this now, just thoughts for a record. For now, we can just remove the |
Sometimes, tasks can hang-on in running state, will be good if we can set max-running time per task or per bulk argument, send notification once it will be passed and give an option to delete or mark as failed.
I think we can have 'last modified attribute, which can be used to implement this functionality and also provide useful info.
The text was updated successfully, but these errors were encountered: