Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0023767Openbravo ERPA. Platformpublic2013-05-08 17:132013-05-23 01:33
caristu 
alostale 
highmajoralways
closedfixed 
5
 
3.0MP243.0MP24 
AugustoMauch
Core
No
0023767: Background process scheduled weekly executed after restart tomcat
Some background process scheduled weekly are executed after restarting tomcat under some circumstances.
1) Go to Process Request and create a new record, schedule a process weekly.
2) Once the process has been executed change its status in ad_process_run to 'PRC', to simulate that the process has fallen down.
3) Go back to the Process Request window, unschedule the process, and schedule it using weekly frequency again
4) Restart Tomcat. Check in the ad_process_run table that after restarting tomcat the process is executed again.
No tags attached.
related to defect 00236533.0MP23 closed alostale Incorrect execution time for daily processes scheduled PM 
related to feature request 0041483 closed caristu update quartz 
Issue History
2013-05-08 17:13caristuNew Issue
2013-05-08 17:13caristuAssigned To => AugustoMauch
2013-05-08 17:13caristuModules => Core
2013-05-08 17:13caristuResolution time => 1371160800
2013-05-08 17:13caristuTriggers an Emergency Pack => No
2013-05-08 17:15caristuIssue Monitored: networkb
2013-05-09 08:23alostaleRelationship addedrelated to 0023653
2013-05-09 08:39alostaleNote Added: 0058514
2013-05-09 20:42johnfandlIssue Monitored: johnfandl
2013-05-09 20:43johnfandlIssue End Monitor: johnfandl
2013-05-09 20:43johnfandlIssue Monitored: johnfandl
2013-05-14 08:14alostaleAssigned ToAugustoMauch => alostale
2013-05-14 09:43alostaleNote Added: 0058627
2013-05-14 09:46alostaleNote Edited: 0058627bug_revision_view_page.php?bugnote_id=0058627#r4708
2013-05-14 09:47alostaleNote Edited: 0058627bug_revision_view_page.php?bugnote_id=0058627#r4709
2013-05-14 09:52hgbotCheckin
2013-05-14 09:52hgbotNote Added: 0058628
2013-05-14 09:52hgbotStatusnew => resolved
2013-05-14 09:52hgbotResolutionopen => fixed
2013-05-14 09:52hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9aa5b4b992aa45323b3d19b815bdf1cf8df6178c [^]
2013-05-14 09:53alostaleReview Assigned To => AugustoMauch
2013-05-17 14:31AugustoMauchNote Added: 0058687
2013-05-17 14:31AugustoMauchStatusresolved => closed
2013-05-17 14:31AugustoMauchFixed in Version => 3.0MP24
2013-05-23 01:33hudsonbotCheckin
2013-05-23 01:33hudsonbotNote Added: 0058810
2019-10-17 17:39caristuRelationship addedrelated to 0041483

Notes
(0058514)
alostale   
2013-05-09 08:39   
This might be related with policy applied on missfire
(0058627)
alostale   
2013-05-14 09:43   
(edited on: 2013-05-14 09:47)
The problem is indeed with misfire policy applied to CronTriggers (the ones used for weekly schedules).

Whereas default policy applied to SimpleTrigger (i.e. daily schedules) don't execute the process on misfire, CronTriggers are executed when they are misfired.

The steps to reproduce are slightly different:

1- Create a new Process Request
2- Schedule it to run weekly on:
  * today's weekday (i.e. Tuesday)
  * Start Date: today (i.e. 14-05-2013)
  * Start Time: one hour *before* now (i.e. 8:00)
3- Schedule the process

When the process is scheduled (step #3), scheduler detects a missfire in the process: it should have been executed today at 8:00 but it didn't. Because of default missfire policy for this kind of schedules, the process is executed. Note process is executed regardless other executions status or Tomcat being restarted.

More info about missfire options: http://nurkiewicz.blogspot.com.es/2012/04/quartz-scheduler-misfire-instructions.html [^]

The misfire policy for all cases should be the same: don't execute on misfire and wait for next regular execution time, meaning if the process couldn't be executed on previous scheduled time (due to server being down or any other issue), it shouldn't be executed until next scheduled time, not on server restart nor on reschedule.

(0058628)
hgbot   
2013-05-14 09:52   
Repository: erp/devel/pi
Changeset: 9aa5b4b992aa45323b3d19b815bdf1cf8df6178c
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue May 14 09:53:08 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/9aa5b4b992aa45323b3d19b815bdf1cf8df6178c [^]

fixed bug 23767: weekly scheduled processes executed on misfire

---
M src/org/openbravo/erpCommon/ad_process/RescheduleProcess.java
M src/org/openbravo/scheduling/OBScheduler.java
---
(0058687)
AugustoMauch   
2013-05-17 14:31   
Code reviewed and verified in pi@2f11b5d67c9a
(0058810)
hudsonbot   
2013-05-23 01:33   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/97c7f6256af7 [^]

Maturity status: Test