You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b391a4a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(remote): budget each beat from the window it protects, not the cadence
Budgeting a beat at the cadence it started on made one number do two jobs. Until
a beat answers, the cadence sits at the 1s floor, so `sendRequest` got a 1s
budget, destroyed the request, and emitted a `daemon_request_timeout`. That
answer is non-terminal, so the cadence never left the floor: on any link where a
round trip takes over a second — a tunneled proxy, a fresh TLS connect per beat
because every timeout tore the socket down, an uplink the upload was saturating
— no beat ever got a window in which to answer, and the lease could lapse on
exactly the slow uploads #2946 exists to protect, with a diagnostic pair every
second.
Cadence and budget are two numbers now. A beat is armed every third of the
window and allowed the whole window to answer in, so a slow first answer sets the
cadence instead of being cut off before it can say anything. The window the loop
assumes before the first answer is the registry's five-second minimum, which is
now shared with the client as `MIN_LEASE_WINDOW_MS` rather than assumed twice:
planning against a longer window than the daemon would ever grant is the same
mistake pointed the other way.
The slow-link case is covered through `sendToDaemon`, which no loopback unit test
travels: the fake daemon answers a beat after 3s — longer than the assumed
cadence, shorter than the assumed window, so a beat budgeted at the cadence is
cut off and one budgeted at the window is not. It asserts the beat stops arriving
once the window is known and counts no `daemon_request_timeout` inside the
upload, in a diagnostics scope because outside one every count reads zero for the
wrong reason. Verified against the previous beat loop: five arrivals there,
none of them answered in time.
0 commit comments