-
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
Scheduler is not triggered or triggered 2 times randomly with native image #17724
Comments
/cc @mkouba |
Are you sure it's not just the event being slightly delayed and you have 2 events in the same second because the one before was a bit delayed? That being said, a one second delay looks like a lot. |
Yes I am sure because in production, we observe the same behavior with
scheduler which fire every 15 minutes
Best regards
Le lun. 7 juin 2021 à 11:30, Guillaume Smet ***@***.***> a
écrit :
… Are you sure it's not just the event being slightly delayed and you have 2
events in the same second because the one before was a bit delayed?
That being said, a one second delay looks like a lot.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#17724 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVC36RVFSCJ3E3LA5RR6A3TRSGTFANCNFSM46HG43UQ>
.
|
Well, I was able to reproduce the
That's far from being ideal of course but at least it's fired "roughly every second". We will need to analyze the scheduling logic and find out if we can do better... |
That's a more serious problem though. I think that I know where the problem is. I'll try to find a fix tomorrow... |
TLDR>This PR should fix the problem, I've replaced the logic used in the What caused the problem?The previous algorithm checked the difference between the last execution time truncated to seconds (e.g. The algorithm was changed:
I believe that this change should be robust enough. Comments and feedback is appreciated... |
- resolves quarkusio#17724 (cherry picked from commit ab144e2)
- resolves quarkusio#17724 (cherry picked from commit ab144e2)
Describe the bug
Randomly, scheduler is not triggered or triggered 2 times with native image
This behavior is not observed in "jvm mode"
Expected behavior
Scheduler should trigger 1 time and doesn't miss any trigger event with native image
To Reproduce
https://github.com/jmpdev34/reproducer-scheduler-native
Steps to reproduce the behavior:
The reproducer should schedule every second based on a cron expression.
When the scheduler method is fired, a log with the datetime is printed
If the scheduler triggers 2 times, a log is printed : 'Already triggered ..."
Note : if none "Already triggered" log appears, try to shutdown et re-start the runner and/or start another activity on the computer (IT tests on a project for example)
Configuration
Environment (please complete the following information):
Output of
uname -a
orver
Linux 344910zx2006 4.15.0-142-generic #146-Ubuntu SMP Tue Apr 13 01:11:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "11.0.9" 2020-10-20
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9+11)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.9+11, mixed mode)
GraalVM version (if different from Java)
graalvm-ce-java11-20.1.0
Quarkus version or git rev
1.11.5.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)maven version 3.6.3
The text was updated successfully, but these errors were encountered: