Reputation: 1607
This morning I ran into some issues using the cfdocument
tag. When a user runs a report, the report just hangs. The report has been running for years with no issues. I even took all of the code out and just put in the following.
<cfdocument format="PDF">this is a test</cfdocument>
The browser still hangs, no errors and the CPU does not jump. I am not sure why this does not work. Any suggestions?
Upvotes: 0
Views: 1178
Reputation: 26
I had a bunch of programs that included file:/// in a cfdocument tag.
I had thought that the file reference would be more efficient, however under coldfusion 2016, it caused occassional, unpredicatable server hanging.
The cfdocument process moves all required files into a work folder, and then produces the pdf.
In CF 2016, there is a setting (Clear Temporary Files Created During CFaaS after (Minutes) that by default clears out work files older than 30 mins.
However, if you use the file:///, then the creation date of that file is not reset, and when that process runs it will delete the file immediately - it is always older than 30 mins.
If the cfdocument process is half way through processing, and it collides with the Clear Temp File process, then a required file disappears, and cfdocument just hangs.
Then subsequent programs with a call to cfdocument also hang, as only one is allowed to execute at any one time.
This then eventually fills up all the cf processing slots, and required a restart of cf to get things going again.
Upvotes: 1
Reputation: 354
Adobe ColdFusion has been known to have bugs wherein an error in the code (e.g. improperly nested HTML tags not closed, DB query errors, invalid variable) inside the <cfdocument></cfdocument>
can silently fail without showing an exception. When this happens, all other cfdocument
requests will pile up behind. This can happen even when other pages, not using cfdocument
, finish just fine.
As you have seen, restarting the CF service also restarts the PDF service and clears the 'pileup'.
The solution is to debug the code inside the cfdocument
tag so that it doesn't throw an exception. Since your issue sounds intermittent, that can be really difficult to debug. You could put everything inside the cfdocument
inside a cftry
, then cfcatch
any exceptions and email them to yourself.
Upvotes: 1