Bug 1197873

Summary: Cron time out should be configurable.
Product: OpenShift Container Platform Reporter: Miheer Salunke <misalunk>
Component: ImageStreamsAssignee: Jason DeTiberus <jdetiber>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 2.2.0CC: adellape, baulakh, bleanhar, bparees, cyrille.puget, erich, jdetiber, jokerman, libra-bugs, libra-onpremise-devel, mfojtik, misalunk, mmccomas, mmcgrath, pruan, xiama
Target Milestone: ---Keywords: FutureFeature, UpcomingRelease
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openshift-origin-cartridge-cron-1.24.1.2-1 Doc Type: Enhancement
Doc Text:
For applications using the Cron cartridge, cron jobs have a default timeout of 20 minutes. This enhancement adds the ability for administrators to configure this global timeout value. Administrators can configure this by creating a /etc/openshift/cron/limits file on each node, and setting a MAX_RUN_TIME parameter in that file to the desired value, such as "10m" for ten minutes. The format of the value must be in a format acceptable to the timeout command: use "s" for seconds, "m" for minutes, "h" for hours, or "d" for days. After applying this update, a cartridge upgrade is required.
Story Points: ---
Clone Of: 1154696
: 1201055 (view as bug list) Environment:
Last Closed: 2015-04-06 17:06:19 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:
Bug Depends On: 1154696    
Bug Blocks: 1201055    

Comment 1 Miheer Salunke 2015-03-02 21:07:57 UTC
Submitted a PR to make cronjob timeout customizable-

https://github.com/openshift/origin-server/pull/6089

Comment 12 Ben Parees 2015-03-11 17:02:05 UTC
Bilhar, how do you want to handle the docs update for this?

Comment 18 Ben Parees 2015-03-13 13:27:47 UTC
Sorry, I put this to ON_QA after tagging the PR merge, but it looks like the merge queue is broken so it never merged.

Comment 19 openshift-github-bot 2015-03-13 17:40:19 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/d5698ee4b33139944958b6662cf1d64a7f21d0c2
Bug 1197873
Bugzilla Link - https://bugzilla.redhat.com/show_bug.cgi?id=1197873
Using this fix a user a can have a cronjob timeout limit customizable

Comment 20 Ma xiaoqiang 2015-03-16 00:45:36 UTC
Wait for the new puddle.

Comment 23 Ma xiaoqiang 2015-03-17 01:25:09 UTC
Check on puddle [2.2.z/2015-03-16.1]

1.create an app with cron cartridge
#rhc app create xiaom1 php-5.4 cron
2. add cron job
# vim .openshift/cron/minutely/test.sh 
sleep 15
#chmod +x test.sh
3.deploy the app
#git commit -amx && git push
4.check the log
No warning message is given out

5.create  /etc/openshift/cron/limits file on the node
# vim /etc/openshift/cron/limits
MAX_RUN_TIME=10s

6. check the log
> tailf  app-root/logs/cron_minutely.log  
__________________________________________________________________________
/var/lib/openshift/xiaom-xiaom1-1/cron/bin/cron_runjobs.sh: line 114: 13377 Killed                  $executor "$SCRIPTS_DIR"
Warning: minutely cron run terminated as it exceeded max run time
__________________________________________________________________________


The configuration file take effect

Comment 25 errata-xmlrpc 2015-04-06 17:06:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0779.html