• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFTHREAD terminate get logged as error

Participant ,
Oct 10, 2008 Oct 10, 2008

Copy link to clipboard

Copied

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?
TOPICS
Advanced techniques

Views

456

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 12, 2008 Oct 12, 2008

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation