aptible / aptible/supercronic

Cause of the delay in reloading crontab?

Open
#150 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.6k
Forks
147
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how the SIGUSR2 reload is handled and how the crontab read is scheduled, using the provided log timestamps to compare signal receipt, job completion, and reload completion. Done means identifying the source of the delay and documenting whether reload behavior can prevent a minutely job from skipping an iteration.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.