We discovered this in Railo, but the lucee code appears to have the issue as well.
In our production code we will sometimes see a thread caught in an endless-cpu intensive loop. with the following simple stack trace:
Thats it. In our read of the code and some difficult debugging we believe that the 'tasks' LinkedList is getting thrown into an inconsistent state because it is not thread-safe. Specifically we believe that the tasks.size() returns > 0, but a tasks.poll() throws an NPE because it is actually empty. The NPE is caught and the loop continues with no change so the NPE will be thrown and ignored again. One fix is to turn 'tasks' into a synchronized list. Another fix may be to not to catch and ignore exceptions.
I prefer the first solution so I will be providing a pull request here shortly.