Skip to main content

Module service

Module service 

Source
Expand description

The master’s gRPC service and its loop: workers’ Control streams, parse uploads and FetchInputs, over MasterCore (see archive/PROJECT.md, Master–worker protocol).

A Hub holds the core and each live worker’s outgoing stream; whatever the core decides to send (assignments, cancels, acknowledgements) is delivered through it, from a stream’s messages and from the loop’s ticks alike.

Structs§

Hub
The core and the workers’ outgoing streams.
LeaseLost
Another master took the lease over: this one’s view is stale, and it must end.

Constants§

ALIVE_INTERVAL
How often the loop beats while it waits between ticks (liveness, see Hub::beat).
ALONE_PER_TURN
The most messages of a failed group handled one by one in a turn (M4B.3): the rest wait for the next, so a failing group doesn’t hold the lock for 40 transactions.
DEFAULT_MAX_MESSAGE_SIZE
The largest message from a worker unless set otherwise ([grpc] max_message_size’s default; gRPC’s own, 4 MiB, is too small for a large root’s parse upload).
DEFAULT_REFRESH_LIMIT
The longest a gauge refresh may take unless set otherwise.
INPUT_CHUNK
The size of one FetchInputs chunk.
MESSAGES_PER_TURN
The most messages of one worker handled in one turn of the master’s lock: what is queued gets through together, and a long queue doesn’t hold rounds and other workers up for long (at most this many Finished, each a few writes; the rest waits for the next turn). 80 from M5.1e’s stress runs (decision 484): bursts recorded fastest, steady throughput unchanged.
NOTIFICATION_RETRY
How long the master waits before listening again after notifications failed.
ROUND_GAP
The least time between the end of a round and one a worker’s Finished wakes (decision 42B): none when the master was idle, so a finish starts its downstream tasks at once; under a stream of finishes at most 20 rounds a second, each taking what arrived meanwhile.
STREAM_BUFFER
How many messages wait for a worker before it is taken for one that stopped reading.