Skip to main content

Module wait_limit

Module wait_limit 

Source
Expand description

How long a command waits for the commit service’s hold on the index, and the variable that sets it. What: How long a command waits for the commit service’s own hold on the index, and the variable that sets it. Why: A hold that is alive but stuck would otherwise stall every later command with no output at all. The wait ends at a generous backstop (CLI_GIT_LOCK_WAIT_SECONDS, thirty minutes by default), read by the wrapper that waits and by the service that waits for a foreign index.lock before it lands a commit; it belongs in the environment of the unit that runs the service.

In TS you’d write (pseudocode):

const limitMs = positiveSeconds(process.env.CLI_GIT_LOCK_WAIT_SECONDS) ?? DEFAULT_LIVE_WAIT_MS;

Constants§

DEFAULT_LIVE_WAIT
How long a command waits for a live holder when the variable is absent or unusable: longer than any ordinary hook run, short enough that a stuck holder is noticed within the hour.
LIVE_WAIT_VARIABLE
Environment variable that sets, in whole seconds, how long a command waits for a lock held by a live process.

Functions§

live_wait_limit
The wait limit this process runs under: the variable in its environment, or the default.
live_wait_limit_from
What: The wait limit for a value of the variable. Why: A missing, zero or malformed value falls back to the default, never to “no limit”.