You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the feature of cluster_cron plugin I'm developing is protecting myself from overlapping cron tasks, example:
I have heavy ruby tasks scheduled every 3 minute, they normally need ~2 minutes to finish, but there might be cases when they start to run longer (for example when DB is under high load), this will cause new cron task to be executed before previous process finishes.
There might be other cases like poor code that will corrupt db data if more than one process is running at a time.
uwsgi_run_command() just starts the command and then master_loop() will log when it is completed as it checks all terminated processes.
I'm not sure how to add such callback, maybe I could make a list with pid, callback pointer and callback arguments (char* would do). Than in master_loop() I would check if pid is on my callback list, if so execute callback function?
Such callback would allow me to unlock the task so next instance can be executed.
The text was updated successfully, but these errors were encountered:
we could also add -subprocess-limit option, if enabled we would check in uwsgi_run_command() it the number of currently running subprocesses exceeds defined limit, before executing any subprocess
just pay attention (as you need to check for process death in the master) to put the cron iteration in a dedicated function as i do not want to come back to messy master.c :)
One of the feature of cluster_cron plugin I'm developing is protecting myself from overlapping cron tasks, example:
I have heavy ruby tasks scheduled every 3 minute, they normally need ~2 minutes to finish, but there might be cases when they start to run longer (for example when DB is under high load), this will cause new cron task to be executed before previous process finishes.
There might be other cases like poor code that will corrupt db data if more than one process is running at a time.
uwsgi_run_command() just starts the command and then master_loop() will log when it is completed as it checks all terminated processes.
I'm not sure how to add such callback, maybe I could make a list with pid, callback pointer and callback arguments (char* would do). Than in master_loop() I would check if pid is on my callback list, if so execute callback function?
Such callback would allow me to unlock the task so next instance can be executed.
The text was updated successfully, but these errors were encountered: