CFTHREAD/Server Monitor Issue

I was working with CFTHREAD today, and found an interesting bug in ColdFusion.  I'd wager that it's within the monitoring stuff new in CF8, but I can't say that for sure.  Here's the problem:

Creating threads with CFTHREAD makes them appear in the server monitor, but they aren't removed from the server monitor when the terminate unless the monitoring/profiling options are enabled.

To put that another way, threads give the appearance of sticking around forever unless you launched them with the monitoring/profiling options enabled.  I have no idea why this is the case, but it is.  The inaccurate state persists across reloads of the monitor, so the bug is somewhere inside CF, not the Flex app.  Threads that are listed but are actually dead don't have a value in the "Java Thread Name" column, you can identify (and ignore) them in the datagrid view.  The chart view, however, stays polluted until you restart CF.

10 responses to “CFTHREAD/Server Monitor Issue”

  1. Damon Gentry

    Interesting catch. I'll have to remember that one.

  2. Charlie Arehart

    Hey Barney, I can confirm your observation and think it may be a bug in the getallactivethreads method. When monitoring is not enabled (and it seems profiling is not a factor), it increments its size by one for each thread spawned, but it never really populates with data (again, unless profiling is enabled). So it creates a new empty array element. Worse, it doesn't not clear itself on completion of the threads.

    Similarly, the getCFThreadQueueStats method reports the threads as running as well, when profiling is not enabled.

    But I can confirm that the threads I'm testing are reporting "completed" in my program that runs and then joins them to view their result. It also doesn't matter if you try to manually terminate the threads.

    So it does seem you've spotted a bug in the Admin API. Hope you'll report it.

  3. Marc Esher

    I thought I was going bananas when I saw this a while ago. I then ran CF under jmxremote and looked at the active threads in jconsole, saw they weren't there, and chalked it up to a glitch.

    I'm glad to know I'm not the only one.

    Thanks for the info, Barney.

  4. ck

    Yeah details of executed threads were not being removed from an internal map if monitoring was not enabled. As rightly pointed out it was a monitoring bug (threads have been working fine, just the data shown in UI was wrong) which is now fixed and should be available in next CF release. You will also be able to see correct spawned from template path even with monitoring disabled.

  5. Antony

    Hi – I'm glad I found this post. I've been trying to find a way to go and kill all the old threads that 'get left behind'. If I'm understanding the above comments correctly – once a thread finishes (without error) it no longer exists, regardless of what the monitor is showing? Has this been corrected in 8.0.1?
    Thanks all

  6. Hemant


    The one issue that was reported to us is cfimage locking file issue. And we are in the process of releasing a hotfix for the same next week. We haven't heard of any other issues from users who have upgraded to CF 8.0.1.

    Please report any issues using or mail me directly at hkhandel at adobe dot com and we will make sure that they are resolved at the earliest.


  7. G M

    We updated to 801 and so far have not seen any issues?

    Any pointers on specific problems will really help us to be better prepared.

  8. Jayesh

    Confirming it One more time.Just veridfied the fix. This issue is fixed in CF 8.0.1. Threads really get away from the Active Threads Server Monitoring Table, once they are done executing.

    Adobe CF Team