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.
- Worker
Info
Enums§
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.