diff --git a/.github/workflows/pr-drools.yml b/.github/workflows/pr-drools.yml index a58c471dfe9..86c52ca7bf7 100644 --- a/.github/workflows/pr-drools.yml +++ b/.github/workflows/pr-drools.yml @@ -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 diff --git a/drools-core/src/main/java/org/drools/core/phreak/PhreakTimerNode.java b/drools-core/src/main/java/org/drools/core/phreak/PhreakTimerNode.java index a895bfc6f64..49b48fcdd84 100644 --- a/drools-core/src/main/java/org/drools/core/phreak/PhreakTimerNode.java +++ b/drools-core/src/main/java/org/drools/core/phreak/PhreakTimerNode.java @@ -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 @@ -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 ); diff --git a/drools-core/src/main/java/org/drools/core/time/impl/PseudoClockScheduler.java b/drools-core/src/main/java/org/drools/core/time/impl/PseudoClockScheduler.java index 5be7a8f171f..a06aefc550e 100644 --- a/drools-core/src/main/java/org/drools/core/time/impl/PseudoClockScheduler.java +++ b/drools-core/src/main/java/org/drools/core/time/impl/PseudoClockScheduler.java @@ -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; } @@ -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(); diff --git a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/compiler/integrationtests/TimerAndCalendarFireUntilHaltTest.java b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/compiler/integrationtests/TimerAndCalendarFireUntilHaltTest.java index 37494cbe71a..832d54ae892 100644 --- a/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/compiler/integrationtests/TimerAndCalendarFireUntilHaltTest.java +++ b/drools-test-coverage/test-compiler-integration/src/test/java/org/drools/compiler/integrationtests/TimerAndCalendarFireUntilHaltTest.java @@ -249,10 +249,12 @@ private Callable 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"); } diff --git a/drools-test-coverage/test-compiler-integration/src/test/resources/logback-test.xml b/drools-test-coverage/test-compiler-integration/src/test/resources/logback-test.xml index b9013a7bbdd..494ff803987 100644 --- a/drools-test-coverage/test-compiler-integration/src/test/resources/logback-test.xml +++ b/drools-test-coverage/test-compiler-integration/src/test/resources/logback-test.xml @@ -36,6 +36,7 @@ +