Uploaded image for project: 'Lucee Development'
  1. LDEV-340

SpoolerEngineImpl$SimpleThread can get in an endless loop

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.5.1.013
    • Fix Version/s: 4.5.2.008, 5.0.0.61
    • Labels:
      None

      Description

      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:

      railo.runtime.spooler.SpoolerEngineImpl$SimpleThread.run(Unknown Source)

      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.

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              colby.litnak Colby Litnak
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: