prefect.utilities.services
critical_service_loop
workload
function on the specified interval
, while being
forgiving of intermittent issues like temporary HTTP errors. If more than a certain
number of consecutive
errors occur, print a summary of up to memory
recent
exceptions to printer
, then begin backoff.
The loop will exit after reaching the consecutive error limit backoff
times.
On each backoff, the interval will be doubled. On a successful loop, the backoff
will be reset.
Args:
workload
: the function to callinterval
: how frequently to call itmemory
: how many recent errors to rememberconsecutive
: how many consecutive errors must we see before we begin backoffbackoff
: how many times we should allow consecutive errors before exitingprinter
: a print
-like function where errors will be reportedrun_once
: if set, the loop will only run once then returnjitter_range
: if set, the interval will be a random variable (rv) drawn from
a clamped Poisson distribution where lambda = interval and the rv is bound
between interval * (1 - range) < rv < interval * (1 + range)
start_client_metrics_server
PREFECT_CLIENT_METRICS_ENABLED
) on the port PREFECT_CLIENT_METRICS_PORT
.
stop_client_metrics_server