Bug 190255

Summary: Job delayed after using crontab -e
Product: Red Hat Enterprise Linux 3 Reporter: Jose Plans <jplans>
Component: vixie-cronAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED ERRATA QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0122 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-18 13:13:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 190430    
Attachments:
Description Flags
Patch fixing delays on vixie-cron 4.x job execution none

Description Jose Plans 2006-04-29 12:42:04 UTC
Description of problem:
Vixie-cron versions 4.x delay the execution of new updated jobs.
If one user edits its cron table at time 0:00, cron wont update its informations
on the first loop but after it, delaying the execution of the task by 1 loop.

Version-Release number of selected component (if applicable):
vixie-cron-4.1-10.EL3

How reproducible:
Always.


Steps to Reproduce:
1. Use an account.
2. Edit its crontab. crontab -e, adding a job (for example * * * * * user
/bin/ls /tmp)
3. Wait for the job to be executed.
  
Actual results:
The job is executed later than expected :

 ---
Apr 13 10:00:10 chancroid crontab[3929]: (ctatman) END EDIT (ctatman)
Apr 13 10:00:10 chancroid crontab[3941]: (ctatman) LIST (ctatman)
Apr 13 10:01:01 chancroid crond[3944]: (root) CMD (run-parts /etc/cron.hourly)
Apr 13 10:01:01 chancroid crond[1537]: (ctatman) RELOAD (cron/ctatman)
Apr 13 10:02:01 chancroid crond[3954]: (ctatman) CMD (user  /bin/ls /tmp/)
 ---

The job is delayed by 1 minute.

Expected results:

 ---
/var/log/cron with vixie-cron-4.1-11test.EL3 installed:
Apr 26 16:11:11 chancroid crontab[10985]: (ctatman) BEGIN EDIT (ctatman)
Apr 26 16:11:33 chancroid crontab[10985]: (ctatman) REPLACE (ctatman)
Apr 26 16:11:33 chancroid crontab[10985]: (ctatman) END EDIT (ctatman)
Apr 26 16:11:33 chancroid crontab[10989]: (ctatman) LIST (ctatman)
Apr 26 16:12:01 chancroid crond[1486]: (ctatman) RELOAD (cron/ctatman)
Apr 26 16:12:01 chancroid crond[10992]: (ctatman) CMD (ctatman  /bin/ls /tmp/) 
 ---

The job is executed in time.

Additional info:

Attached you will find a patch that solves the issue. The main loop has
load_database called too late, and after the job execution tasks; setting it up
after cron_sleep and before find_jobs, I believe, is the right place to populate
the infos to the job descriptions.

Comment 1 Jose Plans 2006-04-29 12:42:05 UTC
Created attachment 128388 [details]
Patch fixing delays on vixie-cron 4.x job execution

Comment 14 Red Hat Bugzilla 2007-04-18 13:13:54 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0122.html