[ 
https://issues.apache.org/jira/browse/OFBIZ-9155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Leonard Lin updated OFBIZ-9155:
-------------------------------
    Description: 
Symptom:
* services that are invoked with "dispatcher.runAsync" seem to 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-trunk as well as with the 
OFBiz 16.11.01 zip file version.

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.

I'm not a OFBiz core developer but only develop modules.
I attached a patch, that makes it work, but not sure if that's the best way to 
solve the problem.

./framework/start/src/main/java/org/apache/ofbiz/base/start/StartupControlPanel.java

line 254: add "serverState.compareAndSet(ServerState.STARTING, 
ServerState.RUNNING);"




  was:
Symptom:
* services that are invoked with "dispatcher.runAsync" seem to 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-trunk as well as with the 
OFBiz 16.11.01 zip file version.

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.

I'm not a OFBiz core developer but only develop modules.
I try to develop a patch and submit on this ticket.


> JobPoller does not run and hence scheduled/async jobs are never run
> -------------------------------------------------------------------
>
>                 Key: OFBIZ-9155
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9155
>             Project: OFBiz
>          Issue Type: Bug
>          Components: base
>    Affects Versions: 16.11.01
>            Reporter: Leonard Lin
>            Priority: Blocker
>         Attachments: StartupControlPanel.java.patch
>
>
> Symptom:
> * services that are invoked with "dispatcher.runAsync" seem to 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-trunk as well as with the 
> OFBiz 16.11.01 zip file version.
> 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.
> I'm not a OFBiz core developer but only develop modules.
> I attached a patch, that makes it work, but not sure if that's the best way 
> to solve the problem.
> ./framework/start/src/main/java/org/apache/ofbiz/base/start/StartupControlPanel.java
> line 254: add "serverState.compareAndSet(ServerState.STARTING, 
> ServerState.RUNNING);"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to