feat(index): bound indexing resources - #1348
Conversation
0b33e28 to
a42336e
Compare
Signed-off-by: 刘冲 <mail@liuchong.dev>
Signed-off-by: 刘冲 <mail@liuchong.dev>
Signed-off-by: 刘冲 <mail@liuchong.dev>
836f376 to
15a98bc
Compare
Use PROC_PIDTASKALLINFO so process-group membership and current resident memory are sampled together. This avoids zero resident-size observations from proc_pid_rusage on freshly spawned workers. Refs DeusData#1347 Signed-off-by: 刘冲 <mail@liuchong.dev>
|
Reviewed in full — every limit traced to its enforcement point and the defaults cross-checked against our recorded benchmarks. The mechanics are strong and the concern is entirely about defaults and surface size. Those are separate, and I do not want the second to overshadow the first. What is genuinely good. The trust boundary is the best part of this PR: caller-supplied The discovery semantics are also exactly right for this project: a limit violation aborts the request rather than returning a truncated file list — a partial index is never published as a complete one. Graph-quality-first is the rule here, and you landed on the correct side of it without being told. Where it cannot ship as-is: the defaults contradict this project's own reference workload.
A resource policy that kills our own reference index out of the box is not a shape we can adopt. If the direction is approved, the version I would argue for is unlimited (off) by default, with the policy opt-in — the enforcement machinery keeps all its value and nothing regresses for existing users. Two more things worth surfacing louder:
Security is clean: no new dependencies, no CI or workflow changes, no prompt-injection surface, and the two raw Whether this project wants a resource-policy subsystem at all is the maintainer's call, not mine, so I have escalated it with the above attached rather than deciding in review. You will also need a rebase — the PR is Thank you for the care in this one; the parts that are good are good for the right reasons. |
|
Thanks for the thorough review. Agreed on the defaults and surface concerns. I'll hold off on reshaping and rebasing until the policy direction is clear. ❤️ |
|
Thank you for waiting while we settled the product direction. The concept is worth pursuing, specifically as an opt-in safety and resource-control surface. We are not ready to change defaults in ways that could regress established large-repository workloads. To make the work reviewable, please split it into atomic slices:
For the public configuration surface, we would prefer a compact profile with a small number of justified overrides rather than eighteen independent keys. Each slice should preserve current defaults, include deterministic tests, and explain the operational failure mode it controls. This approves further work in that opt-in shape, but it is not yet a merge commitment for a particular API. Thank you for the thoughtful trust-boundary analysis and for giving us room to establish a maintainable direction. |
|
Thank you for the direction. I have rebuilt the work in the opt-in shape you asked for, as a stack of six small PRs rather than a reshaped version of this branch. Opening them fresh gives each slice its own review thread and a clean diff against current The stack
PRs 1–3 are your slices 2–4. PR 4 is the compact profile you asked for. PRs 5 and 6 answer point 1 of your first review — the watcher rebuild that fails into the logs and leaves the user on a stale graph with no obvious signal. PR 1 is ready for review; the rest are drafts until the one below it is settled, so you are never asked to review two moving diffs at once. An honest note about the split. You asked for four slices and I am handing you six, plus six review threads instead of one. Splitting also has real costs here: because a fork PR has to target a branch in this repository, each PR's diff carries the commits under it until the one below merges, so the later diffs look larger than the work they add. And six threads means six CI runs and six places for the conversation to fragment. If you would rather have one PR, say so and I will drop the stack and make the same changes on this branch instead — same content, same defaults, one thread. I split it because you asked for atomic slices and I think each of these is genuinely separately decidable, but the shape is your call, not mine, and I would rather ask than make you review six things you did not want. Defaults Everything defaults to Slice 1, exact-root safety, is not in the stack
Three capabilities from this branch are dropped on purpose
The public surface is now I have not touched this branch or this PR. Close it in favour of the stack, leave it open as context, or tell me to bring the work back here and close the six — whichever costs you least. |
What does this PR do?
Adds one immutable, configurable resource policy for ordinary indexing requests and enforces it across discovery, supervised workers, and persistence.
resource_limit_exceedederrorscross-repo-intelligenceon its existing database-only pathRelated to #1347
Validation
make -f Makefile.cbm test: 6791 passed, 4 skippedmake -f Makefile.cbm lint-ci: passedconfig --help: verified all resource keysChecklist
git commit -s)make -f Makefile.cbm test)make -f Makefile.cbm lint-ci)