fix(forgejo): guard faceted issue/pull queries, raise limit to 4Gi #939
No reviewers
Labels
No labels
burndown-2026-06
burndown-2026-08
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/advocate
role/director
role/exec
role/frontend
role/gamedev
role/human
role/platform
role/qa
role/science
role/sysadmin
state
ambient
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/infrastructure!939
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/forgejo-crawler-oom"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #909. Forgejo has OOMKilled 3 times in the last 30h and is doing it again right now, at a higher crawl intensity than the 2026-08-24 incident.
What is happening
A crawler is walking the permuted issue/pull filter space.
repo.Issuesresponses reached 347548ms on the container that died at 01:36:21 UTC.repo.Issueshits peaked at 28,883 per 10 minutes (~48/s), up from a ~2,000-3,600 baseline, ramping from ~00:40 UTC.Traefik attribution over 2h on
forgejo.coilysiren.me:forgejo-runner/v12.13.2- 44,712 (legitimate)meta-externalagent/1.1- 4,251 + 2,200git/2.52.0- 952Eight "browsers" within 3 percent of each other is one fleet rotating UA strings, not organic traffic.
What this changes
1. Enforced guard on the faceted query space only. New
Middleware/forgejo-faceted-query-limit(average: 2, burst: 10, period: 1s) andIngressRoute/forgejo-faceted-queryatpriority: 100, matching/<org>/<repo>/(issues|pulls)only when one oflabels,milestone,assignee,poster,projectis present.This implements the "steer, do not block" posture from #909: plain
?state=and?q=pages stay on the fast path, and code browsing, raw,/src/, and/api/stay open.2. Memory limit 1500Mi -> 4Gi. The tracked value had drifted below the live 3Gi, so an Ansible converge would have cut headroom on a service that was already OOMing. Kai approved 4Gi on both.
What this deliberately does not do
externalTrafficPolicy: Local. Already applied 2026-08-24 and proven ineffective: klipper-lb forwards through a pod netns, so the SNAT happens before Traefik. Documented indocs/forgejo-deploy-plan.mdso it stops being re-proposed.The rate bucket is global because source IP is still masked. Per-source needs ServiceLB bypassed (Traefik on hostPort/hostNetwork) or MetalLB, which is separate work.
Verification status
kubectl diff -f deploy/forgejo.ymlpasses server-side dry-run: both new CRs are schema-valid, and the Deployment diff is scoped to the memory line plus dropping a stalerestartedAtannotation.pre-commit run --all-filesis green.The guard is not runtime-verified.
kubectl applywas blocked by the operator permission classifier in my session, so nothing has been applied live. The rate numbers and thepriority: 100route need a real apply plus the check indocs/forgejo-deploy-plan.mdbefore anyone should trust them.