Skip to main content

Module supervisor

Module supervisor 

Source

StructsΒ§

SupervisorConfig
The full configuration used by the zcashd-compat supervisor task.

EnumsΒ§

ChildOutcome πŸ”’

ConstantsΒ§

PEER_SELECTION_OPTIONS πŸ”’
zcashd options that add P2P peers and accumulate across the command line, so the supervisor’s own -connect cannot override them.
SUPERVISOR_ACTIVE_METRIC πŸ”’
SUPERVISOR_DISABLED_METRIC πŸ”’
SUPERVISOR_EXHAUSTED_METRIC πŸ”’

StaticsΒ§

SUPERVISED_ZCASHD_PID πŸ”’
The pid of the currently running supervised zcashd child, or 0 when none.

FunctionsΒ§

is_command_resolvable
Returns true if the given command path is resolvable as an executable.
is_executable πŸ”’
Returns true when path points to an executable regular file.
reject_peer_selection_extra_args
Rejects zcashd_extra_args entries that would change which peers the supervised zcashd talks to.
restart_backoff_delay πŸ”’
Calculates capped exponential restart backoff from the base delay and consecutive exit count.
run
Runs the zcashd-compat zcashd supervisor until shutdown.
sanitize_child_log_line πŸ”’
Returns a sanitized log line with ANSI escape/control noise removed.
set_supervision_active_metrics πŸ”’
set_supervision_config_disabled_metrics
Sets metrics for zcashd-compat mode when zcashd supervision is intentionally disabled.
set_supervision_inactive_metrics πŸ”’
set_supervision_unexpectedly_disabled_metrics
Sets metrics for zcashd-compat mode when supervision has unexpectedly stopped.
should_reset_restart_count πŸ”’
Returns true when a child ran long enough to make previous failures stale.
spawn_log_task πŸ”’
Forwards a child output stream into Zebra logs under zcashd_compat.zcashd.
spawn_zcashd πŸ”’
Spawns zcashd with zcashd-compat arguments and connects child output streams.
terminate_abandoned_zcashd
Terminates a supervised zcashd child that the supervisor task never got to shut down, blocking the calling thread.
terminate_child πŸ”’
Attempts graceful termination of the zcashd-compat child process.
wait_for_child_or_shutdown πŸ”’
Waits until either a shutdown request arrives or the child exits.
wait_for_delay_or_shutdown πŸ”’
Waits for delay to elapse, returning true if shutdown is requested first.