Bug 1321576

Summary: Kie server : async nodes not executed asynchronously
Product: [Retired] JBoss BPMS Platform 6 Reporter: Bernard Tison <btison>
Component: Kie-ServerAssignee: Edson Tirelli <etirelli>
Status: CLOSED EOL QA Contact: Karel Suta <ksuta>
Severity: unspecified Docs Contact:
Priority: urgent    
Version: 6.2.0CC: kverlaen, rrajasek
Target Milestone: ER3   
Target Release: 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 20:04:39 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:

Description Bernard Tison 2016-03-28 12:55:23 UTC
Description of problem:

On Kie server, async nodes are not executed asynchronously, even when the Executor service is available.


Version-Release number of selected component (if applicable):
BPMS 6.2.0.GA

How reproducible:
Always reproducable

Steps to Reproduce:
1. Install BPMS Kie Server
2. Start Kie Server
3. Make sure the Executor component is available and started
In the logs:
----
14:22:34,427 INFO  [org.jbpm.executor.impl.ExecutorImpl] (ServerService Thread Pool -- 53) Starting Executor Component ...
         - Thread Pool Size: 1
         - Interval: 3 SECONDS 
         - Retries per Request: 3
----
4. Unzip and build the attached project (the project has a simple process with a async script node) 
----
$ mvn clean install
----
5. create a container on the kie-server for the project:

HTTP POST http://localhost:8080/kie-server/services/rest/server/containers/async
with payload

----
{
  "release-id" : {
    "group-id" : "org.jboss.btison",
    "artifact-id" : "async-test",
    "version" : "1.0"
  }
} 
----

6. start an instance of the process

HTTP POST http://localhost:8080/kie-server/services/rest/server/containers/async/processes/test.async-node/instances

With payload:

----
{}
----


Actual results:

In the kie server log:

----
14:40:41,497 WARN  [org.jbpm.workflow.instance.node.AsyncEventNodeInstance] (http-/127.0.0.1:8080-3) No async executor service found continuing as sync operation...
14:40:41,498 INFO  [stdout] (http-/127.0.0.1:8080-3) In async node
----

Expected results:
Async node is executed asynchronously. 

Additional info:
Possible root cause: on kie-server, the Executor service is not added to the KModuleDeploymentService. As a result, when the RuntimeEnvironmentBuilder is bootstrapped (in KModuleDeploymentService.boostrapRuntimeEnvironmentBuilder()), the Executor service impl is not added to the Runtime environment.
On business-central, the Executor service in injected through CDI in the KModuleDeploymentService. Kie-server does not use CDI.

Comment 2 Kris Verlaenen 2016-03-29 14:16:12 UTC
Maciej, could you investigate this?

Comment 3 Maciej Swiderski 2016-03-29 15:54:36 UTC
great catch Bernard! and you're right with missing executorService on deploymentService so you actually solve it as well. Remaining part for me was to write a test case. Once again, thanks a lot.

PRs sent and being built before the merge...

Comment 5 Karel Suta 2016-04-18 08:14:36 UTC
Verified in 6.3.0ER3