DanielLoth / SQLServerJobRunner

MIT License
5 stars 2 forks source link

Second watchdog SQL Agent job that monitors the first and strictly enforces the time limit #4

Open DanielLoth opened 1 year ago

DanielLoth commented 1 year ago

This isn't something that's strictly necessary, but it might be of interest for anyone who wants strict enforcement of the time limit.

Presently the system is designed to be cooperative, and reasonably strict so as to enforce that cooperation. But for non-cooperative jobs, there'll always be at least one execution where they can go off the rails under the current paradigm.

For example, they might have a 20 second time limit but might run for 20 minutes. When such a job does return, its violation of the rules will be noted (and, if it has violated the time limit rule too many times, the job will not be re-executed again).

Creating two jobs - the job runner itself, and an accompanying watchdog - could allow the watchdog to issue a kill command on an as-needed basis (i.e., when the watched job runner is running a task and that task is seen to be taking more than the permitted time).