State transitions

This section describes state transitions for:

In addition, state transitions are shown for the handling of resources with respect to the ManageFaults service group attribute.

See The next set of diagrams illustrate the following state transitions:.

The states shown in these diagrams are associated with each resource by the agent framework. These states are used only within the agent framework and are independent of the IState resource attribute values indicated by the engine.

The agent writes resource state transition information into the agent log file when the LogDbg parameter, a static resource type attribute, is set to the value DBG_AGINFO. Agent developers can make use of this information when debugging agents.

Click the thumbnail above to view full-sized image.

When the agent starts up, each resource starts with the initial state of Detached. In the Detached state (Enabled=0), the agent rejects all commands to bring a resource online or take it offline.

When the resource is enabled (Enabled=1), the open entry point is invoked. Periodic Monitoring begins after open times out or succeeds. Depending on the return value of monitor, the resource transitions to either the Online or the Offline state. In the unlikely event that monitor times out or returns unknown, the resource stays in a Probing state.

Click the thumbnail above to view full-sized image.

When resources are in a steady state of Online or Offline, they are monitored at regular intervals. The intervals are specified by the MonitorInterval parameter for a resource in the Online state and by the OfflineMonitorInterval parameter for a resource in the Offline state. An Online resource that is unexpectedly detected as Offline is considered to be faulted. Refer to diagrams describing faulted resources.

Click the thumbnail above to view full-sized image.

When the agent receives a request from the engine to bring the resource online, the resource enters the Going Online state, where the online entry point is invoked. If online completes successfully, the resource enters the Going Online Waiting state where it waits for the next monitor cycle.

If monitor returns a status of online, the resource moves to the Online state.

If, however, the monitor times out, or returns a status of "not Online" (that is, unknown or offline), the agent returns the resource to the Going Online Waiting state and waits for the next monitor cycle.

When the OnlineWaitLimit is reached, the clean entry point is invoked.

Click the thumbnail above to view full-sized image.

Upon receiving a request from the engine to take a resource offline, the agent places the resource in a Going Offline state and invokes the offline entry point.

If offline succeeds, the resource enters the Going Offline Waiting state where it waits for the next monitor.

If monitor returns a status of offline, the resource is marked Offline.

If the monitor times out or return a status "not offline," the agent invokes the clean entry point. Also, if, in the Going Offline state, the offline entry point times out, the agent invokes clean entry point.

Click the thumbnail above to view full-sized image.

This diagram describes the activity that occurs when a resource faults and the RestartLimit is reached. When the monitor entry point times out successively and FaultOnMonitorTimeout is reached, or monitor returns offline and the ToleranceLimit is reached, the agent invokes the clean entry point.

Note   For the Windows platform, the FaultOnMonitorTimeout attribute has no significance. Instead, the monitor entry point is allowed to continue to completion.

If clean fails, or if it times out, the agent places the resource in the Online state as if no fault occurred.

If clean succeeds, the resource is placed in the Going Offline Waiting state, where the agent waits for the next monitor.

Click the thumbnail above to view full-sized image.

This diagram describes the activity that occurs when a resource faults and the RestartLimit is not reached. When the monitor entry point times out successively and FaultOnMonitorTimeout is reached, or monitor returns offline and the ToleranceLimit is reached, the agent invokes the clean entry point.

Note   For the Windows platform, the FaultOnMonitorTimeout attribute has no significance. Instead, the monitor entry point is allowed to continue to completion.

Refer to the diagram "Resource fault without automatic restart," for a discussion of activity when a resource faults and the RestartLimit is reached.

Click the thumbnail above to view full-sized image.

For a persistent resource in the Online state, if monitor returns a status of offline and the ToleranceLimit is not reached, the resource stays in an Online state. If monitor returns offline and the ToleranceLimit is reached, the resource is placed in an Offline state and noted as FAULTED. If monitor returns "not offline," the resource stays in an Online state.

Likewise, for a persistent resource in an Offline state, if monitor returns offline, the resource remains in an Offline state. If monitor returns a status of online, the resource is placed in an Online state.

Click the thumbnail above to view full-sized image.

When the resource is disabled (Enabled=0), the agent stops Periodic Monitoring and the close entry point is invoked. When the close entry point succeeds or times out, the resource is placed in the Detached state.

The next set of diagrams illustrate the following state transitions: