Error in RamCache run can turn into CPU hog

Description

I noticed a Lucee server sitting idle an eating an entire CPU core. I traced it down to a thread running from RamCache whose _run() method was throwing an exception. The catch{} block is empty so I don't know what the exception was (you know how much I hate that...) but the issue is that the sleep() calls is AFTER the _run() method means that when the _run() method errors, the thread skips the sleep and the loop going into super speed where it just runs over and over again with no delay. Not cool. Move the sleep FIRST in the loop to protect against the CPU getting eaten up. Also, why aren't we logging errors that happen in this thread? Minimally, set a run time flag and just log the error the first time it happens so it doesn't fill the logs.

Environment

None

Activity

Brad Wood 
8 April 2019 at 14:23

Thanks!

Brad Wood 
6 April 2019 at 05:10

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 6 April 2019 at 05:04
Updated 8 April 2019 at 14:23
Resolved 8 April 2019 at 09:01