|
NAMEThe watchdog threadDESCRIPTIONThe watchdog is forked away on startup and takes care of paused workflows. The system has a default configuration but you can override it via the system configuration.The namespace is system.watchdog. The properties are:
STATIC METHODS_sig_hupSignal handler for SIGHUP registered with the forked worker process.Triggered by the master process when a reload happens. _sig_termSignal handler for SIGTERM registered with the forked worker process.Trigger by the master process to terminate the worker. start_or_reloadStatic method to instantiate and start the watchdog or make it reload it's config.terminateStatic method that looks for watchdog instances and sends them a SIGHUP signal.This will NOT kill the watchdog but tell it to gracefully stop. METHODSrunForks away a worker child, returns the pid of the worker__main_loopWatchdog main loop (child process).Runs until the package scope variable $TERMINATE is set to 1. __purge_expired_sessionsPurge expired sessions from backend if enough time elapsed.__scan_for_paused_workflowsDo a select on the database to check for waiting or stale workflows, if found, the workflow is marked and reinstantiated, the id of the workflow is returned. Returns undef, if nothing is found.__flag_for_wakeup( wf_id )Flag the workflow with the given ID as "being woken up" via database.To prevent a workflow from being reloaded by two watchdog instances, this method first writes a random marker to create "row lock" and tries to reload the row using this marker. If either one fails, returnes undef. __wake_up_workflowRestore the session environment and execute the action, runs in eval block and returns the error message in case of error.__auto_archive_workflowsArchive workflows whose "archive_at" date was exceeded.__flag_for_archiving( wf_id )Flag the workflow with the given ID as "being archived" via database to prevent a workflow from being archived by two watchdog instances.Flagging is done by updating DB field "workflow_archive_at" with an intermediate value of 0. It is updated to "null" once archiving is finished, so a permanent value of 0 indicates a severe error. Returns 1 upon success or "undef" if workflow is/was archived by another process.
Visit the GSP FreeBSD Man Page Interface. |