Bug 883492
Summary: | Cron cartridge does not prevent subsequent runs of particular frequency if a job is already running for that frequency | ||
---|---|---|---|
Product: | OKD | Reporter: | Paul Morie <pmorie> |
Component: | Containers | Assignee: | Paul Morie <pmorie> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | libra bugs <libra-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 2.x | CC: | jhou |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-12-19 19:26:32 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Paul Morie
2012-12-04 17:39:55 UTC
Test job code (designed to work with a ruby app): ========== #!/bin/bash date >> $OPENSHIFT_RUBY_LOG_DIR/test.log sleep 120 echo 'test job complete!' >> $OPENSHIFT_RUBY_LOG_DIR/test.log ========== This should go in the app's .openshift/cron/minutely and have the executable bit set. I've introduced locking that will result in a skipped run for any frequency if a job for that frequency is already running. A skipped run will result in a message like so in /var/log/messages: :SKIPPED: minutely cron run for openshift user '53e8fde8be0742d1bb42cad10da24345' Fix is present in devenv AMI 2556. Verified on devenv_2558 Steps: 1. Create one app and embed cron cartridge 2. Create a minutely job that runs for 2 minutes and marks its end in a log file in the application's dir (sample code below). #!/bin/bash date >> $OPENSHIFT_PHP_LOG_DIR/test.log sleep 120 echo 'test job complete!' >> $OPENSHIFT_PHP_LOG_DIR/test.log 3. Git push Check locking is enabled for cron cartridge On app's gear: [php1-2558t.dev.rhcloud.com logs]\> tailf test.log Wed Dec 5 21:39:03 EST 2012 test job complete! On instance, a skipped run is logged Dec 5 21:43:02 ip-10-151-4-201 root[31265]: user-cron-jobs Wed Dec 5 21:43:02 EST 2012: :START: minutely cron run for openshift user 'ef037b3bb9494ffca77423bfdae2fc84' Dec 5 21:43:02 ip-10-151-4-201 root[31275]: user-cron-jobs Wed Dec 5 21:43:02 EST 2012: :SKIPPED: minutely cron run for openshift user 'ef037b3bb9494ffca77423bfdae2fc84' |