Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1056348

Summary: Threaded audit log only showing first sequence of events
Product: [Retired] JBoss BPMS Platform 6 Reporter: Kris Verlaenen <kverlaen>
Component: Eclipse ToolingAssignee: Mario Fusco <mfusco>
Status: CLOSED CURRENTRELEASE QA Contact: Marek Baluch <mbaluch>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.0CC: mbaluch
Target Milestone: ER1   
Target Release: 6.0.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 19:49:58 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:
Attachments:
Description Flags
test_500
none
test_1000
none
test_1000_with_sleep_10000
none
Issue screencast. none

Description Kris Verlaenen 2014-01-22 02:57:36 UTC
Description of problem:
When using a threaded audit logger, it saves the events regularly with the given delay.  The audit view will only show the first sequence of events however, due to how the XML is generated.

KieRuntimeLogger log = KieServices.Factory.get().getLoggers().newThreadedFileLogger(ksession, "test", 1000);
...
log.close()

This now generates something like:

<object-stream>
<org.drools.core.audit.WorkingMemoryLog>
  <version>6.1</version>
  <events>
    <org.drools.core.audit.event.RuleFlowVariableLogEvent>
      <type>32</type>
      <processId>com.sample.evaluation</processId>
      <processName>Evaluation</processName>
      <processInstanceId>1</processInstanceId>
      <variableId>reason</variableId>
      <variableInstanceId>reason</variableInstanceId>
      <objectToString>Yearly performance evaluation</objectToString>
    </org.drools.core.audit.event.RuleFlowVariableLogEvent>
    ...
  </events>
  <engine>PHREAK</engine>
</org.drools.core.audit.WorkingMemoryLog>
<org.drools.core.audit.WorkingMemoryLog>
  <version>6.1</version>
  <events>
    ...
  </events>
  <engine>PHREAK</engine>
</org.drools.core.audit.WorkingMemoryLog>
...

The audit log will only consume the first sequence of events however, additional sequences in the XML are ignored (due to a change in the audit log XML where it used to save all events as one sequence instead I believe)

Comment 2 Marek Baluch 2014-03-21 19:55:08 UTC
I can see more than the first sequence in the audit log  but only for 

ks.getLoggers().newThreadedFileLogger(ksession, "test", 1000);

If I use

ks.getLoggers().newThreadedFileLogger(ksession, "test", 500);

or 

ks.getLoggers().newThreadedFileLogger(ksession, "test", 1000);

runProcess(ksession, taskService);
Thread.sleep(10000);
runProcess(ksession, taskService);
Thread.sleep(10000);
runProcess(ksession, taskService);
Thread.sleep(10000);

then the log is missing events. You can try the attached log files to reproduce the behaviour.

Tested on JBDSIS 7.0.1.CR1.

Comment 3 Marek Baluch 2014-03-21 19:55:37 UTC
Created attachment 877473 [details]
test_500

Comment 4 Marek Baluch 2014-03-21 19:55:54 UTC
Created attachment 877474 [details]
test_1000

Comment 5 Marek Baluch 2014-03-21 19:56:15 UTC
Created attachment 877475 [details]
test_1000_with_sleep_10000

Comment 6 Mario Fusco 2014-03-24 09:58:39 UTC
I am not able to understand where the problem is. I tried to open all the 3 provided log files in the Audit View and they seem to be rendered correctly. Nevertheless those logs contain several events and very likely I am just missing some of them. Could you be a bit more precise listing in detail which events that you expected to be shown in the audit view is actually missing?

Comment 7 Marek Baluch 2014-03-24 14:04:46 UTC
Created attachment 878076 [details]
Issue screencast.

Comment 8 Marek Baluch 2014-03-24 14:07:33 UTC
The version I'm using is JBoss Drools Core/Guvnor 6.0.1.Final.

Attachment 878076 [details] shows what happens when I import the attached test_500 file.

Comment 9 Mario Fusco 2014-03-24 14:47:10 UTC
6.0.1.Final still didn't include this fix. 
I checked both master and 6.0.x branch and it is working as expected on both.

Comment 10 Marek Baluch 2014-04-28 21:18:49 UTC
Cannot verify at this time. I must wait for JBDSIS to pick up the fix.

JBDSIS 7.0.1.GA includes JBoss Drools Core/Guvnor 6.0.1.Final.

Comment 11 Marek Baluch 2014-06-06 08:35:47 UTC
Verified on JBDSIS 7.0.2.CR1.