referrerpolicy=no-referrer-when-downgrade

Module worker

Source
Expand description

Functionality common to both prepare and execute workers.

Modules§

security
Functionality for securing workers.
thread
Functionality related to threads spawned by the workers.

Structs§

PipeFd
A wrapper around a file descriptor used to encapsulate and restrict functionality for pipe operations.
WorkerInfo

Enums§

WorkerKind

Constants§

JOB_TIMEOUT_OVERHEAD
Some allowed overhead that we account for in the “CPU time monitor” thread’s sleeps, on the child process.

Functions§

cpu_time_monitor_loop
Loop that runs in the CPU time monitor thread on prepare and execute jobs. Continuously wakes up and then either blocks for the remaining CPU time, or returns if we exceed the CPU timeout.
get_total_cpu_usage
Calculate the total CPU time from the given usage structure, returned from [nix::sys::resource::getrusage], and calculates the total CPU time spent, including both user and system time.
pipe2_cloexec
recv_child_response
Get a job response.
run_worker
Initializes the worker process, then runs the given event loop, which spawns a new job process to securely handle each incoming request.
send_result
stringify_errno
stringify_panic_payload
Attempt to convert an opaque panic payload to a string.