OffScan scripts
- Last UpdatedAug 06, 2024
- 2 minute read
OffScan scripts are called when the object is taken OffScan. This script type is primarily used to clean up the object and account for any needs to address as a result of the object no longer executing.
If an object is taken OffScan, either directly, or indirectly because its engine is taken OffScan, all in-progress asynchronous scripts for that object are requested to shut down by setting a Boolean shutdown attribute for the script to true. A well-written script checks this attribute before and after time-consuming operations. If the script takes more than 30 seconds to complete, a warning appears in the logger that the script is not responding to the shutdown command. However, the script is allowed to complete and is not terminated by force. This all takes place on the engine’s main thread and could potentially hang the engine. During this time, the script might also time out and as a result exit before executing all its logic.
OffScan scripts for redundant AppEngines
This section outlines whether or not the script will run under various scenarios, including including deploy, forced failover, system failure, system startup, and undeploy operations.
The selected redundancy mode, Legacy or Run Warm, does not change the behavior of OffScan scripts for redundant engines. For both Legacy and Warm Redundancy modes:
-
When failover occurs, OffScan scripts are triggered when the Active engine goes OffScan.
-
OffScan scripts are NOT triggered when the Standby engine goes OffScan.
|
Both redundancy modes |
Primary engine (server 1) |
Backup engine (server 2) |
OffScan script |
||
|---|---|---|---|---|---|
|
Action |
Initial state |
End state |
Initial state |
End state |
Script execution |
|
Deploy |
Down |
Active OnScan |
Down |
Standby |
Offscan scripts do not execute during a deploy operation. |
|
Forced Failover |
Active OnScan |
Standby |
Standby |
Active OnScan |
Offscan scripts execute when the backup engine transitions to offscan. |
|
Server 1 Failure (hard shutdown) |
Active OnScan |
Down |
Standby |
Active OnScan |
Offscan scripts do not execute when server 1 has a hard shutdown. |
|
Server 2 Failure (hard shutdown) |
Active OnScan |
Active OnScan |
Standby |
Down |
Offscan scripts do not execute in the event of a server 2 failure (no state change for server 1). |
|
Graceful shutdown of Server 1 platform or engine using OCMC |
Active OnScan |
Down |
Standby |
Active OffScan |
Offscan scripts execute when the OCMC shuts down a platform or active engine on server 1. The standby engine on server 2 transitions from standby to active offscan. |
|
Graceful shutdown of Server 2 platform or engine using OCMC |
Active OnScan |
Active OnScan |
Standby |
Down |
Offscan scripts do not execute when the OCMC shuts down a platform or standby engine on backup server 2. |
|
Start Server 1 only |
Down |
Active OnScan |
Down |
Down |
Offscan scripts do not execute when the primary engine on server 1 starts and transitions to its prior state of active onscan. |
|
Start Server 2 (Server 1 running) |
Active OnScan |
Active OnScan |
Down |
Standby |
Offscan scripts do not execute when the backup engine starts (state of the active engine running on server 1 does not change). |
|
Undeploy |
Active OnScan |
Down |
Standby |
Down |
Offscan scripts execute during an undeploy operation when the active engine goes offscan before it shuts down. |