Document |
public event TaskLongProcessingDocumentWarningHandler LongProcessingDocumentWarning
A long processing document is a document currently being processed where no other documents or child documents have completed processing in LongProcessingDocumentCriteriaInSec seconds (see RunTask or RunTaskBlocking), indicating no perceived processing of documents being completed.
Although never encountered through our many tests of document data sets, DocumentTaskEngine has not been tested against every malformed document in the world. This event is a guard against potential malformed documents that may cause infinite processing loops. This argument should be sufficiently large (default is 10 minutes) to account for the processing of very large documents, e.g., PDFs with 1000's of pages, or very large Excel files.
Developers should sign up for this event to guard against malformed documents that may create infinite processing loops. After the first warning at LongProcessingDocumentCriteriaInSec seconds, this event will be fired every 30 seconds until either the user sets event ref bool argument 'prepareForAbort' to true, the long running document finishes (and resets internal timer), or elapsed run time equals 2*LongProcessingDocumentCriteriaInSec at which time a fatal exception will be thrown. If fatal exception is thrown, then all processing output for the task run will be lost and the task should be requeued into 2 or more separate tasks (subsets of the original document set).
Setting event argument 'prepareForAbort' to true, gives the document task engine time to mark the long running document with an error and save it and also close the output files. This should preserve all processing results from the task run. Once this is all completed then event Completed will be fired with argument 'completedButHasZombieDocumentThread' set to true. In the Completed event handler, after all normal user post task notifications are completed, the user should call AbortTask to kill the "zombie" processing task.