1 Reply Latest reply on Oct 12, 2008 11:24 AM by BKBK

    CFTHREAD terminate get logged as error

    SpiderFromMars Level 1
      When I terminate a thread in this manner to kill runaway thread:

      <cfloop list="#t#" index="i">
      <cfif findNoCase('RUNNING', evaluate('#i#.status')) gt 0>
      <cfsilent>
      <cfthread action="terminate" name="#i#" />
      </cfsilent>
      </cfif>
      </cfloop>

      Each thread that is terminated gets logged in the application log of the CF administrator with the following value:
      myThread34940: null

      How do I keep this from getting logged? Why does CF look at these as application errors?
        • 1. Re: CFTHREAD terminate get logged as error
          BKBK Adobe Community Professional & MVP
          I can see your point. But it is so by design. When you terminate a thread, Coldfusion assigns it the value null. However, whenever a Java object assumes a null value, it causes the NullPointerException. That is why terminations are logged as errors. To get more information, append <cfdump var="#cfthread#"> after the loop.

          I can imagine one good reason for this design. Here, you have chosen to terminate the threads. It can happen that some other process beyond your control intervenes and prematurely terminates a thread. You should like to have that logged.