/[Apache-SVN]
ViewVC logotype

Revision 1779596


Jump to revision: Previous Next
Author: jleroux
Date: Fri Jan 20 09:56:56 2017 UTC (7 years, 3 months ago)
Changed paths: 2
Log Message:
Fixed: JobPoller does not run and hence scheduled/async jobs are never run
(OFBIZ-9155)

Symptom:
* services that are invoked with "dispatcher.runAsync" stay "pending" in the 
job-list and never get executed
* scheduled jobs don't get executed

Steps to Reproduce
* Login to /webtools
* Schedule a Job to run in 5 mins, (for example service "clearAllEntityCaches")
* Wait 7mins

Expected:
* the scheduled service "clearAllEntityCaches" is not "pending" anymore but 
should have status "finished"

Actual:
* scheduled service "clearAllEntityCaches" is still "pending"

Analysis:
The problem can be reproduced with the OFBiz 16.11 branxh as well as 
with the OFBiz 16.11.01 zip file version and the trunk

JobPoller does get started on OFBiz start but does get stuck on line:
org.apache.ofbiz.service.job.JobPoller.java: 213-215 

The reason is that the "Start.ServerState" never reaches "RUNNING"

Doing a full-text scan through the whole source code shows, that there is no 
code at all that sets the ServerState to "RUNNING"

Comparing it to the 15.11-branch. There used to be a line:
serverState.compareAndSet(ServerState.STARTING, ServerState.RUNNING)

no such line exists in 16.11 anymore.

jleroux:  I confirm the behaviour in R16 branch as well as in trunk.

Leonard's "patch" is a good solution and works for the R16 branch which is less 
changed than the trunk when compared to R15. 

The same applies to the trunk with the relative block of code which contains
if (serverState.get() == ServerState.STOPPING) {

The line Leonard propose to add was obviously missed during the recent 
refactoring.

Thanks: Leonard Lin

Changed paths

Path Details
Directoryofbiz/branches/release16.11/framework/start/src/main/java/org/apache/ofbiz/base/start/StartupControlPanel.java modified , text changed
Directoryofbiz/trunk/framework/start/src/main/java/org/apache/ofbiz/base/start/StartupControlPanel.java modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26