Expand description
The lines the commit service writes about its life and about the time each request took.
What:
The lines the resident commit service writes to its log (standard error,
which the service manager keeps in the journal)
about its own life and about the time each request took:
when it started,
one line for each request it answered with the
phases of the wait,
a retire request,
and its exit with the reason and the uptime.
Why:
After a slow commit the journal held ready and nothing else,
so nothing said whether the time went to the queue,
to
another program’s hold on the index,
to the landing or to a service being replaced.
These lines cost one clock read per
phase edge and one line per request;
they name no person (the commit’s message and identities never appear) and are not
shown to the person at the terminal.
In TS you’d write (pseudocode):
console.error(`cli-git-service: answered request=${id} queued_ms=${queued} lock_wait_ms=${lockWait} total_ms=${total}`);Structs§
- Answered
- Everything the line for one answered request states.
- Arrival
- When a connection was accepted and how long its request line took to arrive.
- Land
Timing - What: The phases of one landing the service itself spent time in, summed over the attempts a moving branch made it repeat. Why: The wait for another program’s hold on the index, the objects, the journal write, the branch move and the index update are the stretches a slow landing can lose time in; whatever else a landing did is reported as the reads that remain.
Enums§
- Exit
Reason - Why a service ended.
Constants§
- LOG_
PREFIX - The prefix of every line the service writes,
which
journalctlshows after the unit name. - SLOW_
LOCK_ STEP - The wait for the index lock that is written down even when no holder was met:
a flush of the marker or a wait that long is a slow landing’s first suspect.
Exempt from a citation under
LQM(class: notice pacing): it times a line the person reads or a log threshold, and nothing waits on it beyond the wait that already exists. Classed once indoc/planning/cli-git-shipped-limits- audit.md, “Exempt limits”; the coordinator’s pick under the owner’s delegation, open to the owner’s veto.
Functions§
- answered_
line - What:
One answered request as a line of
key=valuewords, without the prefix. Why: Text values are written in Rust’s quoted form, which has no raw newline or unescaped quote, so the line stays one line whatever a client sent; the numbers are whole milliseconds. - exit_
line - The line for the service’s own exit, with the time it ran since it began serving.
- in_
service - What:
Whether this process is the resident service, which names its release once at the start (
set_context). Why: Code both programs run (the auto-push’s fetch, the shadow’sinit) records Git’s words in the service’s log in the service and as a client entry in the wrapper; a control that captures the service’s entries counts as the service. - index_
update_ ms_ of - What:
The duration, in whole milliseconds, that an
answeredline gives for removing the conclusion state and building and installing the new index. Why: The step was first logged assync_ms, which reads as a disk sync although it is the follow-up of the landing that holds the index lock; it isindex_update_msnow. Lines already in the journal keep the old key, so a reader asks for the new key and falls back to the old one. - lock_
notes_ fields - The words for what the wait for the lock found, empty when the lock was free at the first placement: the placements that found it held, the time spent flushing the marker and the time spent waiting, and the first and the last description of the held lock.
- log
- What:
Writes one line to the service’s log.
Why:
Standard error is the service manager’s journal;
one
writecarries the prefix, the line, its own time and the newline together, and a closed or broken stream is not the service’s failure. - log_
entry - What:
Writes one entry of a priority, with fields a reader can filter the journal on, and gives where it went.
Why:
The userinfo of every URL is masked (a push or a review reports what Git and a server said), the line on standard error
is one line,
then it states its own time (
stamped_line); a native entry also carries the time asCLI_GIT_AT_MS, the priority and the context. Nothing here waits: seejournald_native. - retire_
line - The line for a retire message: a client of another release found this service and asked it to finish its batch and exit.
- set_
context - Names the release and instance every later entry carries as
CLI_GIT_RELEASEandCLI_GIT_INSTANCE; the first call wins. - sink
- The sink of this process.
- stamped_
line - What:
The text of one log line:
the prefix,
the line,
the time of the event as
at_ms=<epoch milliseconds>at the end, and the newline. Why: The journal stamps a line when it receives it, and under load that can be seconds after the event; the line states its own time, at the end so that the prefix and the first word stay where readers look for them. - started_
line - The line a service writes as it starts,
before
ready: the release it announces, the protocol, its process and the worktree instance it serves. - wait_
line - What:
The line for the end of a wait for the index lock,
or nothing when the lock was free at the first placement and the acquisition was quick.
Why:
Written when the wait ends,
not with the answer,
so a landing that fails afterwards still leaves what it waited for.
It says the total,
how it split between flushing the marker and waiting for a holder,
how many times the lock was found held,
and what the first and the last look found (
lock_found,lock_last). - wall_
millis - The wall clock in whole milliseconds since the Unix epoch, the time a log line states for its own event.