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. |
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)