Skip to content

Commit

Permalink
more logging in drools-core
Browse files Browse the repository at this point in the history
  • Loading branch information
tkobayas committed Sep 20, 2024
1 parent c970161 commit 7aca1fd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr-drools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ jobs:
maven-version: ${{ matrix.maven-version }}
cache-key-prefix: ${{ runner.os }}-${{ matrix.java-version }}-maven${{ matrix.maven-version }}
allow-snapshots: true
# - name: Build drools-core
# run: mvn -B clean install -Dquickly --file drools-core/pom.xml
- name: Build drools-core
run: mvn -B clean install -Dquickly --file drools-core/pom.xml
# - name: Build drools-compiler
# run: mvn -B clean install -Dquickly --file drools-compiler/pom.xml
- name: Run loop Linux
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,16 @@ private void scheduleTimer(TimerNode timerNode,
return;
}

log.info("scheduleTimer: trigger.hasNextFireTime() = " + trigger.hasNextFireTime().getTime() + ", timestamp = " + timestamp);

if ( trigger.hasNextFireTime().getTime() <= timestamp ) {
// first execution is straight away, so void Scheduling
if ( log.isTraceEnabled() ) {
log.trace( "Timer Fire Now {}", leftTuple );
}

log.info(" ok, this one fires now");

TupleImpl childLeftTuple = doPropagateChildLeftTuple(sink, trgLeftTuples, stagedLeftTuples, leftTuple );
if (childLeftTuple.getStagedType() != LeftTuple.NONE) {
// Flag the newly created childLeftTuple to avoid a reevaluation in case it gets
Expand All @@ -305,6 +309,8 @@ private void scheduleTimer(TimerNode timerNode,
TimerNodeJob job = new TimerNodeJob();
TimerNodeJobContext jobCtx = new TimerNodeJobContext( timerNode.getId(), trigger, leftTuple, tm, sink, smem.getPathMemories(), reteEvaluator );

log.info(" then, schedule the next one");

DefaultJobHandle jobHandle = (DefaultJobHandle) timerService.scheduleJob( job, jobCtx, trigger );
leftTuple.setContextObject( jobHandle );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public JobHandle scheduleJob(Job job, JobContext ctx, Trigger trigger) {
TimerJobInstance jobInstance = jobFactoryManager.createTimerJobInstance( job, ctx, trigger, jobHandle, this );
jobHandle.setTimerJobInstance( jobInstance );
internalSchedule( jobInstance );
logger.info(" scheduleJob : jobHandleId = " + jobHandle.getId() + ", fireTime = " + trigger.hasNextFireTime().getTime() );
return jobHandle;
}

Expand Down Expand Up @@ -150,6 +151,9 @@ private synchronized long runCallBacksAndIncreaseTimer( long increase ) {
TimerJobInstance item = peek();
long fireTime;
while (item != null && item.getTrigger().hasNextFireTime() != null && (fireTime = item.getTrigger().hasNextFireTime().getTime()) <= endTime) {

logger.info(" runCallBacksAndIncreaseTimer : jobHandleId = " + item.getJobHandle().getId() + ", fireTime = " + item.getTrigger().hasNextFireTime().getTime() );

// remove the head
queue.poll();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,12 @@ private Callable<Boolean> ruleHasFired(String ruleName, int times) {
}

private void advanceTimerOneSecond() {
LOG.info(" -- advanceTimerOneSecond");
timeService.advanceTime(1, TimeUnit.SECONDS);
}

private void activateRule() {
LOG.info(" -- insert trigger");
triggerHandle = ksession.insert("trigger");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<!-- <logger name="org.drools.ancompiler" level="debug"/>-->

<logger name="org.drools.compiler.integrationtests" level="info"/>
<logger name="org.drools.core" level="info"/>

<root level="warn">
<appender-ref ref="consoleAppender" />
Expand Down

0 comments on commit 7aca1fd

Please sign in to comment.