Skip to main content

Module core

Module core 

Source
Expand description

The master’s protocol logic, apart from any transport: registering workers, their messages, disconnects, the periodic tick, parse uploads and inputs (see archive/PROJECT.md, Master–worker protocol and Worker lifecycle).

The gRPC service (crate::service) only moves messages between workers’ streams and this core, so everything here is tested without a network.

Modules§

task_api
A task’s REST requests through its agent (M4.11h, the user’s B2): the master runs them through the API’s own router as the task’s identity, on an allow-list of routes, so a task needs no URL or token and reaches nothing else.

Structs§

Arrivals
What has arrived from workers before the master handled it (cheap to clone; clones share it). A stream’s reader records each message as it is read, before the message waits for the master’s lock, so a busy master doesn’t count its own delay against workers:
Group
A turn’s Starteds and Finisheds, each kind in its order (M4B.3): stored together by MasterCore::handle_group.
MasterCore
The master’s state between messages.
MasterTimings
How the master’s loop and its parse jobs are paced.
ReportLimits
How much of what a worker reports for people (wait step hosts, warnings) the master keeps (B183): an honest agent sends a few short records; more are dropped, longer texts cut.
RoundLimits
How much one round or pass of the master does at most (B18’s caps, decision 493), each a SCHEDR_HIDDEN__MASTER__* limit: a burst goes over a few rounds instead of holding one up.
Settings
The master’s timing, sent to every worker in Registered so all behave the same.

Enums§

CoreError
Why the master refused or failed something.
RoundPart
A part of a round, in the order a round runs them (master_round_part_seconds). The service takes the core’s lock for each on its own (decision 469).

Constants§

DEFAULT_SCRIPT_ROOT_GRACE
How long a script root may be unreported before it counts as absent (decision 303).
USAGE_EVERY
How often a worker’s usage is written from its heartbeats (decision 463): a minute, the samples’ own step (decision 464), so the stored figure is never older than a sample needs and a heartbeat adds no statement in between.