Skip to content

Commit 6336657

Browse files
author
t
committed
docs(node,config): reconcile the concurrency-cap comments with the fix (#62)
The max_concurrent_git_ops and git_service_timeout_secs doc-comments (and .env.example) described the info/refs and withheld-blob paths as unbounded follow-up gaps. Both are now closed (#174): the comments reflect the read/write pool split, the per-caller sub-cap, and that every capped path is duration-bounded with process-group teardown. Verified the pattern-doc pre-ship checklist: every git_permit / write-permit / per-caller site holds only a timeout+teardown git path, and all three size knobs are range(1..=1_048_576). Closes the #174 work. No behavior change.
1 parent 57c6e01 commit 6336657

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎.env.example‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ GITLAWB_MAX_PACK_BYTES=2147483648
109109

110110
# Max seconds a served git upload-pack / receive-pack (clone / push) may run
111111
# before it is aborted with a 504. Bounds a hung git that would otherwise pin a
112-
# worker and, on push, the repo write lock. Does NOT cover the info/refs
113-
# advertisement or the withheld-blob path, which remain unbounded. Default 600.
112+
# worker and, on push, the repo write lock. Also bounds the info/refs
113+
# advertisement and the withheld-blob pack build (#174). Default 600.
114114
GITLAWB_GIT_SERVICE_TIMEOUT_SECS=600
115115

116116
# Max concurrent git-receive-pack (push) operations, in a pool separate from the

‎crates/gitlawb-node/src/config.rs‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ pub struct Config {
172172
/// its process group torn down, in seconds. Bounds a git that neither
173173
/// finishes nor disconnects. Must be positive; set it very large to
174174
/// effectively disable the bound. Default: 600s (10 min), generous for large
175-
/// clones. Does not cover the ref advertisement (`info/refs`) or the
176-
/// withheld-blob fetch path (`upload_pack_excluding`, a blocking
177-
/// `spawn_blocking` a tokio timeout cannot cancel); both remain unbounded.
175+
/// clones. Also bounds the ref advertisement (`info/refs`) and the withheld-blob
176+
/// pack build (`upload_pack_excluding`'s pack-objects stage), which now share the
177+
/// same timeout + process-group teardown (#174).
178178
#[arg(
179179
long,
180180
env = "GITLAWB_GIT_SERVICE_TIMEOUT_SECS",
@@ -243,20 +243,20 @@ pub struct Config {
243243
/// cap is a different axis (500 connections each fan out to git +
244244
/// pack-objects + threads). Size below the process budget with headroom.
245245
///
246-
/// A permit is held for the whole op. upload-pack/receive-pack are
247-
/// duration-bounded by `git_service_timeout_secs`, but the `info/refs`
248-
/// advertisement and the withheld-blob (`upload_pack_excluding`) path are
249-
/// not, so a hung git on those two paths holds its slot until it exits, so a
250-
/// stuck advertisement permanently costs one unit of capacity. Bounding
251-
/// those paths' duration is tracked as separate follow-up.
246+
/// This is the READ pool (`git_read_semaphore`): upload-pack and both info/refs
247+
/// advertisements. Authenticated pushes draw from a separate write pool
248+
/// (`max_concurrent_git_pushes`) and each caller is additionally bounded by
249+
/// `max_concurrent_reads_per_caller`, so an anonymous flood can neither shed a
250+
/// push nor monopolize reads (#174).
252251
///
253-
/// The same two paths have the mirror gap on cancellation: the permit frees
254-
/// when the handler future drops (client disconnect), but neither reaps its
255-
/// git child — `info/refs` runs a bare `Command`, and `upload_pack_excluding`
256-
/// a blocking `spawn_blocking` a dropped future cannot cancel — so the child
257-
/// runs to completion after its slot is freed and live git can briefly exceed
258-
/// the cap. The main pack path (`run_git_service`) tears its process group
259-
/// down on drop, so this is confined to the same two follow-up paths.
252+
/// A permit is held for the whole op, and every capped path is now
253+
/// duration-bounded and reaps its process group on disconnect: upload-pack,
254+
/// receive-pack, and both info/refs advertisements run under
255+
/// `git_service_timeout_secs` with `process_group(0)` teardown, and the
256+
/// withheld-blob (`upload_pack_excluding`) pack-objects stage runs on the async
257+
/// side under the same teardown. So a hung git can no longer pin a slot and a
258+
/// client disconnect no longer orphans its git child (#174 closed the two
259+
/// duration/cancellation gaps this comment previously tracked as follow-up).
260260
///
261261
/// Default: 128. Must be between 1 and 1_048_576; the ceiling keeps the value
262262
/// well under tokio's `Semaphore` permit limit so an oversized value is a

0 commit comments

Comments
 (0)