-
Notifications
You must be signed in to change notification settings - Fork 118
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
Cause of the delay in reloading crontab? #150
Comments
Am I understanding it correctly that supercronic itself is running a job that sends the signal to reload the configuration? If so, does this seem like a reasonable approximation?
Which, if this test is accurate, shows supercronic has no issue reloading itself in less than a second:
I do notice that the logs you shared are missing the "waiting for jobs to finish" message (maybe you omitted it for brevity?), and in my testing with two jobs I am able to reproduce an explainable delay: the exit and reload signals do both wait for currently running jobs to finish:
Yields the result
Does this seem to be your issue? |
Sorry, I missed the 'waiting for jobs to finish' log in my earlier post. Yes, I see the reload waits for the jobs to finish causing the jobs to miss an iteration . Do you have any suggestions to avoid this? We have multiple jobs that runs every minute and say one of the job gets removed from the schedule, then from the next iteration on, we do not want this job to be scheduled at the same time the other jobs shouldn't get delayed /miss an iteration during the reload of the crontab. |
Hi
We have a script that tries to scan the etc/crond directory, populate crontab file and compares it with the crontab file that supercronic uses to schedule, when there are changes tries reload the crontab.
When we try to reload the cron tab by using the below command, we notice a delay between the time the command is issued to reload the crontab and the read crontab .
kill -USR2 $pid
Please help to understand the cause for the delay? Do we have any options to avoid this delay? As this seem to cause the minutely jobs to skip an iteration due to the delay during reload time.
Mar 13 09:39:00 supercronic: time="2024-03-13T09:39:00Z" level=info msg=starting iteration=0 job.command="populate_and_load_crontab_from_etc_crond.sh" job.position=0 job.schedule="* * * * "
Mar 13 09:39:50 supercronic: time="2024-03-13T09:39:50Z" level=info msg="received user defined signal 2, reloading crontab"
Mar 13 09:39:50 supercronic: time="2024-03-13T09:39:50Z" level=info msg="job succeeded" iteration=0 job.command="populate_and_load_crontab_from_etc_crond.sh" job.position=0 job.schedule=" * * * *"
Mar 13 09:40:27 supercronic: time="2024-03-13T09:40:27Z" level=info msg="read crontab: "
Thanks
The text was updated successfully, but these errors were encountered: