As soon as I put back my scheduled tasks and restart Lucee with Lucee-Tomcat Service Control, CPU at 50% again. Many threads about ScheduledTaskThread. I’ll try to add my scheduled tasks one by one to see which combination provoke that. Note that all scheduled tasks are on pause…
There’s some certain combinations of scheduled task intervals which get stuck in an infinite loop trying to find the next schedule
Is this bug has been already reported?
I wonder if I should use something else than Lucee to manage the scheduled tasks…
This is sort of a side-question, but the fact that the Lucee restart button didn’t stop those scheduled task threads is probably a bug in itself. The Lucee service restart actually shuts down the JVM and starts a fresh one. The Lucee restart button leaves the JVM and the servlet container (tomcat) and simply unloads and reloads the Lucee context in memory. IMO, that should include any scheduled task threads.
I’ll wait for a patch and if the patch don’t come in time, I will track down the scheduled task that provoke it or use another tool to manage the scheduled tasks instead of Lucee.
Use the profile feature in FR to profile the thread for a few seconds and then see what it is doing. The previous issues with scheduled tasks was due to an infinite loop int he code trying to figure out when to run the task next.
I tried to find a pattern for the bug. It’s directly related to the scheduled task interval :
10000 (2,777778 hours) ok
10400 (2,8888889 hours) ok
10800 (3 hours) bug
10810 (3,0027778 hours) ok
14400 (4 hours) bug
14700 (4,0833333 hours) ok
18000 (5 hours) ok
At first I thought it was coming from a rounding issue and/or data type (int vs float), because it was buggy just with whole number like 3 and 4 hours, but it’s okay with 5 hours. It’s strange.
For now I just changed the interval 14400 to 14700 for my problematics scheduled tasks and the Lucee CPU dropped at 0%.
I wonder if it’s specific to our server configuration or if anybody who use an interval of 14400 will have this issue…
If I can help in anyway to solve this issue, let me know!
Note that if my scheduled task use an interval of 14400 and start at {t ‘06:00:00’}, it’s fine. But if it’s start at 00:00:00, or 00:30:00, or 01:00:00 the bug still occur. This is indeed a bug depending on the combination of start time and interval, and maybe end time as well.
I too also had scheduled tasks high cpu when converting from railo to lucee. I binnary searched around 250 tasks and found 5 offenders. No rhyme or reason to what they were
I don’t see the version 5.3.8.156 in the Update section of the server admin. Is it normal?
I suppose the version 5.3.8.159-SNAPSHOT should be fine too? I tried the version 5.3.8.159-SNAPSHOT with my old scheduled tasks settings and everything look normal in the CPU usage.