About Worker Jobs
This page provides more information on worker jobs, the processes that complete units of work for the Work Queue Manager. You can view, manage, and monitor worker jobs like other processes by using the %SYSTEM.ProcessOpens in a new tab class. If you need to need to know whether a given process is a worker job, you can call $system.WorkMgr.IsWorkerJob() from within the process; that is, you can call the IsWorkerJob() method of the %SYSTEM.WorkMgrOpens in a new tab class.
The Work Queue Manager directs worker jobs using the controller process, which is a dedicated process that performs the several operations:
-
Starts up worker jobs
-
Manages the number of worker jobs
-
Detects and report on halted worker jobs
-
Records workload metrics
-
Detects inactive work queues
-
Deletes work queues
A worker job can be in any of the following states:
-
Waiting to attach to a work queue
-
Waiting for units of work. A worker job can be in this state for only a short period of time before it is released.
-
Active. A worker job is active only when it is making forward process while executing a unit of work.
-
Blocked by a lock or event while processing a unit of work. A worker job that is blocked is not active. If a worker becomes blocked and there is additional work in the work queue, the Work Queue Manager may activate a retired worker or start up a new worker. When a worker job is no longer blocked, the number of active workers may exceed the maximum number of active workers specified for the work queue. If this occurs, the controller process retires the next worker that completes a unit of work. Consequently, there may be short periods of time when the active number of worker jobs exceeds the maximum number of worker jobs specified for a given work queue.
-
Retired and available to be activated rapidly.
Unused worker jobs remain available for use by other Work Queue Manager queues for a short period of time. The timeout period is subject to change and is deliberately not documented. After the timeout period expires, the worker is removed.
If a worker job is actively processing a work item for a queue that has been deleted or cleared, the system waits a very short period of time before issuing an EXTERNAL INTERRUPT error. If the worker job continues processing after the error, the system waits for the number of seconds specified in the DeleteTimeout property before forcibly terminating the worker and starting up a new worker to process the unit of work.
The superserver starts the worker jobs, which means that they run under the name of the operating system user used by the superserver process. This username may be different from the currently logged-in operating system user.