ColdFusion Muse

Threads Not Terminating on ColdFusion 8.0.0

Mark Kruger June 17, 2008 7:21 PM Coldfusion Tips and Techniques, Coldfusion 8 Comments (3)

Over the past few days on CF Talk Ian Skinner has been struggling tuning an application that makes use of CFTHREAD. In his application a process spawns threads for creating report files. Ian Reports that the process would spawn the threads, but the threads themselves would neither complete gracefully nor respond to a "terminate" action (<cfthread action="terminate" ...>). No suggestions from the muse or anyone else seemed to help. Finally he upgraded to ColdFusion 8.0.1 and the problem appears to be resolved. Threads complete gracefully without hanging around.

Nothing in the 8.0.1 release notes raises any red flags with me that would indicate why updated to 8.0.1 resolved the issue. I suspect that something very specific about his JVM was causing it. Still, it's nice to know if you run into this ticklish issue there is a way around it.

  • Share:

3 Comments

  • Antony's Gravatar
    Posted By
    Antony | 6/17/08 10:24 PM
    I watched that HoF thread with interest.

    There was a bug in the server monitor in 8.0 that didn't remove old threads from the display (http://www.barneyb.com/barneyblog/2007/11/26/cfthr...)
    Perhaps it was more than just a server monitor problem?
  • Mike Brunt's Gravatar
    Posted By
    Mike Brunt | 6/18/08 6:03 AM
    This is interesting because I have an inkling that it was not just a reporting issue. When I get the time I will try some load tests against 8.0 and 8.01
  • Mark Kruger's Gravatar
    Posted By
    Mark Kruger | 6/18/08 7:04 AM
    @Antony

    No, I don't think it was related to server monitor - although that's where he was viewing the hanging threads so it's reliability is a factor. The code in question would eventually crash the server.

    @Mike

    Ian actually ran his code without the file access or report generation and got the same result - so my take is that it is not a reporting issue.

    @both

    Thinking about Antony's comment I suppose it is possible that Ian's code was too intense for the server (he was creating a large group of threads) and was causing it to hang. Meanwhile, the reporting in server monitor was incorrect causing him to assume that cfthread was the culprit when really it was just the sheer about of work he was attempting. I think I could make a case for that - but he seemed pretty thorough in how he went about troubleshooting the issue.