cfthread and request timeout in coldfusion

I have been playing around with CFthread in CF9 and assumed the threads would behave the same way as in Java, where the thread doesn’t die until all the operations are completed.

I was expecting a similar behavior with CFthread as well,since I was planning to spawn a asynchronous thread and let it complete a file upload to cloud using CFHTTP. In the process I found the following after some testing and playing around:

  1. The CFthread basically respects the CF admin panel timeout if it’s set and kills the thread after the timeout period.
  2. It doesn’t respect the request timeout set using the CFsetting tag in onRequestStart or any where in the code.
  3. There are still certain tags that don’t obey the CFthread request timeout,they are CFFTP,CFEXECUTE, CFX tags and CFStoredProc.

So if you like start a asynchronous thread that runs for a longer time than the request timeout set in the CFadmin,please use the following ways:

  1. Un-check the request timeout settings in the CFadmin and then set request timeout for all other requests using the cfsetting @ onrequestStart function.
  2. Use either of the above tags that don’t respect the CFthread timeout.
  3. Use the event gateways if needed.

Just thought some one could find it useful.

No related posts.

Post a Comment

Your email is never shared. Required fields are marked *

*
*