Bug 192783 - Job delayed after using crontab -e
Summary: Job delayed after using crontab -e
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: vixie-cron
Version: 4.0
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: Marcela Mašláňová
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks: 176344
TreeView+ depends on / blocked
 
Reported: 2006-05-22 22:17 UTC by Jose Plans
Modified: 2007-11-30 22:07 UTC (History)
3 users (show)

Fixed In Version: RHBA-2007-0685
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-08-02 08:05:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch fixing the database delay bug. (763 bytes, patch)
2006-05-22 22:17 UTC, Jose Plans
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0685 0 normal SHIPPED_LIVE vixie-cron bug fix and enhancement update 2007-11-15 17:34:46 UTC

Description Jose Plans 2006-05-22 22:17:01 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-36

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.

It is also true for FC5.

jose

Comment 1 Jose Plans 2006-05-22 22:17:02 UTC
Created attachment 129833 [details]
Patch fixing the database delay bug.

Comment 2 Jason Vas Dias 2006-05-26 22:14:57 UTC
There are several reasons why jobs should be loaded AFTER find_jobs; 
o jobs could be removed, so we could end up with a child returning for
  a job that has been removed.
o we don't want any processing that may need to be done to affect the
  runs of the current jobs; eg. a user could create a massive job
  the loading of which could delay the runs of the current job list.

With the current implementation, it is better that the current job list 
should be run first, and then load database can modify the job list after
it has been run.

I am working on a cron enhancement that will remove this limitation of the
implementation.

This is not actually a bug, as cron makes no guarantees about when jobs will
be loaded, only about when they are run after loading.

I will consider it as an enhancement and will try out the fix in fedora releases
before submitting it to a RHEL release.

Comment 5 RHEL Program Management 2006-09-05 19:38:47 UTC
The component this request has been filed against is not planned for inclusion
in the next update. The decision is based on weighting the priority and number
of requests for a component as well as the impact on the Red Hat Enterprise
Linux user-base: other components are considered having higher priority and the
number of changes we intend to include in update cycles is limited.

Comment 6 RHEL Program Management 2006-09-05 19:49:07 UTC
Product Management has reviewed and declined this request.  You may appeal this
decision by reopening this request. 

Comment 8 Marcela Mašláňová 2006-09-20 12:09:52 UTC
vixie-cron-4.1-_44-delayed_database.patch solves this problem, should be 
included in RHEL.

Comment 14 Marcela Mašláňová 2007-05-11 11:43:47 UTC
Frozen in errata, could we propose it for 4.6?

Comment 19 Red Hat Bugzilla 2007-08-02 08:05:55 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-0685.html



Note You need to log in before you can comment on or make changes to this bug.