KBI 310783 Issue Addressed: Long Running PowerShell Or WMI Script Rule Always Gets Cancelled

Version

Argent Advanced Technology 3.1A-1310-A or below

Date

Tuesday, 17 Dec 2013

Summary

Long running PowerShell Script Rule or WMI Script Rule always fails to complete because it is cancelled by Supervising Engine after it running for over five minutes

Technical Background

The Argent Supervising Engine keeps an internal list of running tasks

Each task has a hardcoded 5-minute timer that is reset whenever any information is returned from the Argent Monitoring Engine process

As a result, if a task is quiet for more than 5 minutes, the Argent Supervising Engine sees this task as a running-away task, and aborts the task

PowerShell Script Rule and WMI Script Rules are implemented using synchronized method ‘Invoke

As the script is executed, the task worker thread of Argent Monitoring Engine process is blocked at the method call

While it is blocked, there is no internal information message Work Order can be returned to the Argent Supervising Engine

After five minutes, the Argent Supervising Engine cancels the task

Argent AT 3.1A-1401-A is enhanced to use asynchronous method ‘InvokeAsync‘ and writes an internal ‘Alive‘ message Work Order every 30 seconds, thus allowing long running scripts to complete

Resolution

Upgrade to Argent Advanced Technology 3.1A-1401-A or later