-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScheduledExecution.getTrigger().getPreviousFireTime() returns the same time as ScheduledExecution.getFireTime() #37567
Comments
/cc @mkouba (scheduler) |
As the behaviour is uniform across two different databases (quartz) and the simple scheduler as well this must be working as intended. |
Hm, I think that the I agree that the javadoc is not clear at all. Furthermore, the Quartz implementation does not correspond to the original intent. We should clarify the docs/javadoc and fix the Quartz impl. |
I think that I was actually wrong. The reason why the A javadoc clarification would not hurt though. |
- log a warning if a Scheduled#every() value is not supported by the underlying scheduler impl - fixes quarkusio#37567
- log a warning if a Scheduled#every() value is not supported by the underlying scheduler impl - fixes quarkusio#37567
- log a warning if a Scheduled#every() value is not supported by the underlying scheduler impl - fixes quarkusio#37567
Describe the bug
The javaoc for
Trigger.getPreviousFireTime()
says:However when run using Quartz and cron-expressions it returns the same time as
ScheduledExecution.getFireTime()
(modulo milliseconds)Expected behavior
Given
When reading the Javadoc for
io.quarkus.scheduler.Scheduled
,io.quarkus.scheduler.ScheduledExecution
andio.quarkus.scheduler.Trigger
I would assume that the first time my@Scheduled
annotated method is executed at time T, that the value ofSceduledExecution.getTriggger().getPreviousFireTime()
isnull
. And the second time it is executed at time T+1 that the value is T.Actual behavior
That the value of
execution.getTrigger().getPreviousFireTime();
at time T is T and at T+1 the value is T+1If I'm misinterpreting the javadoc it is unexpected that the
ScheduledExecution
andTrigger
interfaces have different methods that returns the same value.How to Reproduce?
TaskBean.schedule()
method to:Output of
uname -a
orver
Darwin DK4N9LVCF.local 21.6.0 Darwin Kernel Version 21.6.0: Wed Oct 4 23:55:28 PDT 2023; root:xnu-8020.240.18.704.15~1/RELEASE_X86_64 x86_64
Output of
java -version
openjdk version "17.0.5" 2022-10-18 OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8) OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode, sharing)
Quarkus version or git rev
3.6.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
Also tested using MSSQL as database. I get the same result when using quarkus-scheduler, i.e. not quarkus-quartz.
Am I just mis-interpreting the javadoc? If so, it would make a lot of sense to have a
getPreviousFireTime()
method onScheduledExecution
that returned T-1 at time T.The text was updated successfully, but these errors were encountered: