Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
OpenXPKI::Server::WatcUser(Contributed Perl DocumOpenXPKI::Server::Watchdog(3)

NAME
       The watchdog thread

DESCRIPTION
       The 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:

       max_fork_redo
	   Retry this often to fork away the initial watchdog process before
	   failing finally.  default: 5

       max_exception_threshhold
	   There are situations	(database locks, no free resources) where a
	   watchdog can	not fork away a	new worker. After
	   max_exception_threshhold errors occured, we kill the	watchdog. This
	   is a	fatal error that must be handled!  default: 10

       interval_sleep_exception
	   The number of seconds to sleep after	the watchdog ran into an
	   exception.  default:	60

       max_tries_hanging_workflows
	   Try to restarted stale workflows this often before failing them.
	   default:  3

       max_instance_count
	   Allow multiple watchdogs in parallel. This controls the number of
	   control process, setting this to more than one is usually not
	   necessary (and also not wise).

	   default: 1

       interval_wait_initial
	   Seconds to wait after server	start before the watchdog starts
	   scanning.  default: 30;

       interval_loop_idle
	   Seconds between two scan runs if no result was found	on last	run.
	   default: 5

       interval_loop_run
	   Seconds between two scan runs if a result was found on last run.
	   default: 1

STATIC METHODS
   _sig_hup
       Signal handler for SIGHUP registered with the forked worker process.

       Triggered by the	master process when a reload happens.

   _sig_term
       Signal handler for SIGTERM registered with the forked worker process.

       Trigger by the master process to	terminate the worker.

   start_or_reload
       Static method to	instantiate and	start the watchdog or make it reload
       it's config.

   terminate
       Static method that looks	for watchdog instances and sends them a	SIGHUP
       signal.

       This will NOT kill the watchdog but tell	it to gracefully stop.

METHODS
   run
       Forks away a worker child, returns the pid of the worker

   __main_loop
       Watchdog	main loop (child process).

       Runs until the package scope variable $TERMINATE	is set to 1.

   __purge_expired_sessions
       Purge expired sessions from backend if enough time elapsed.

   __scan_for_paused_workflows
       Do 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_and_fetch_workflow( wf_id )
       Flag the	database row for wf_id.

       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_workflow
       Restore the session environment and execute the action, runs in eval
       block and returns the error message in case of error.

perl v5.32.0			  2020-08-29	 OpenXPKI::Server::Watchdog(3)

NAME | DESCRIPTION | STATIC METHODS | METHODS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=OpenXPKI::Server::Watchdog&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help