Managing farm jobs

In Farm Manager when an action is applied or saved, the result can be a simple IPF Control Database metadata update or creation of a farm-level asynchronous job. When complex asynchronous processing is needed, records are locked and an entry is written to the Farm Jobs table with the status of Pending.

Entries are processed in the order they are written, so the farm jobs processor in the IPF Control Service looks for the next entry and sets the status to Running. If the job must be expanded, new entries are created in the Farm Jobs table with a Parent Job ID of this current task. The status of the current task is changed to Waiting.

The farm jobs processor looks for a job with a status of Waiting and if one is found, it looks for pending jobs with a matching Parent Job ID and either an empty server or a server that matches the current machine. If an entry is found, the status is changed to Running. When the job is processed, its status is changed to Complete. If the job fails, the status is set to Incomplete.

The farm jobs processor also looks for jobs with a status of Waiting for which all the sub-jobs, jobs with a matching Parent Job ID, have a status of Complete. When found, the status of the waiting parent job is set to Complete.

Only one parent job can be processed at a time. Also, if the oldest entry in the Farm Jobs table has a status of Waiting or Running, the other waiting parent jobs are not processed. This is to ensure that subsequent jobs work from an up-to-date system state.