Expand description
The bytes a push and its processes move, sampled, and the clock that stops it on a stall.
What:
The progress of a push: whether the push and everything it started are at work, sampled at a small interval, and the
clock that stops it on a stall (no sign of work for the stall window, and no open connection to a remote).
Why:
A fixed deadline stops a slow push that is still working and lets a stuck push take its whole deadline. A process shows
that it works in three ways, each read from /proc, and only a tree that shows none of them is stalled:
bytes moved: rchar plus wchar of /proc/<pid>/io, summed over the tree;
processor time: utime plus stime of /proc/<pid>/stat growing;
a task able to run or waiting for the disk: state R or D in /proc/<pid>/task/<tid>/stat.
Measured on 2026-11-03, which decided the three:
a 30 MB push to a local bare remote moved 94 MB of rchar and 156 MB of wchar over its four processes while
read_bytes was 64 KB and write_bytes came late and in bursts, so the block-layer counters see neither pipes nor
sockets and lag behind the transfer;
rchar and wchar count read and write calls, not send and recv (102 bytes for 100000 bytes through
send/recv, 100102 through read), so a stretch that only curl performs shows through the pipe that feeds it;
a dd of 64 MB with conv=fsync was in state D in six of seven looks and used 0 processor ticks (a tick is 10 ms),
so a wait for the disk shows in neither bytes nor processor time, only in the state;
a parent in vfork is in state D with 0 ticks, the way the controls hold a tree in disk wait exactly;
a process reading a silent socket and a sleep are in state S with a constant tick count, so a wait on a server
that says nothing shows nothing in the process; only the connection’s state shows it.
What each costs: bytes miss work that moves none; processor time makes a process that spins or polls look alive, and its
resolution is a tick; state D makes a process wedged for ever in the kernel (a dead network file system) look alive, and
state R one that is only waiting for a processor; no total time bounds them (owner decision, see below). None of them sees
a server that checks the push before it answers: that tree is in state S, indistinguishable from a dead peer by its
processes alone. What tells them apart is the connection: a process of the tree that holds a TCP socket in state
ESTABLISHED (read from the kernel’s socket diagnostics, tcp_sockets.rs) has a remote that has not closed it, and a tree
with such a socket is waited for, however long it shows nothing. The owner’s answer “Wait while connected (Recommended)”
(2026-11-03) is the rule; the rest is pick 5 of doc/planning/cli-git-shipped-limits-audit.md, which the coordinator made
under the owner’s delegation (“Pick options as if I had picked them”, 2026-11-03) and the owner may veto: no stall window
for a connected push, no ceiling for any push, no low-speed abort.
What the code cannot observe: a peer that vanished without a reset leaves the socket ESTABLISHED until TCP gives up
(retransmission for unacknowledged data, keepalive probes for an idle connection), which the owner accepted.
Where /proc/<pid>/io does not exist (no /proc, or a kernel without task I/O accounting) nothing is measured and the
stall window is a fixed deadline, as before.
In TS you’d write (pseudocode):
const clock = new Clock(child.pid, { stallMs }); while (!exited) { const stop = clock.check(); if (stop) return stop; }Structs§
- Clock
- What:
The clock of one bounded child: it says when the child has stalled or passed its fixed deadline.
Why:
The waiting loop asks it every few milliseconds; it reads the counters only every
SAMPLE_INTERVAL. - Meter
- What: The work of the tree under a root so far, and whether a sample saw any sign of work since the one before. Why: A process that ends takes its counters with it, so each process is remembered by its number and start time, and only what it moved or used since it was last seen is added; a task able to run or waiting for the disk is a sign of work at the sample that finds it.
- Wait
Report - What a push that waits for its remote with the connection open has shown, once it has been silent for the stall window.
Constants§
- SAMPLE_
INTERVAL - How often the counters of the tree are read.