You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: bound task listings and stored task data #284
Any user can fill MongoDB's storage or exhaust the memory of the API:
GET /tasks?view=FULL&page_size=2047 loads every matching document, with task_original, into memory (list(cursor)) before serializing. Tasks with large inline inputs (inputs[].content) can make a single listing larger than the memory limit of an app instance.
Each POST /tasks stores the task twice (task and task_original) before any backend accepts it. Tasks that fail validation, and tasks that no backend accepts, are kept (as SYSTEM_ERROR) together with their owner rules.
Inline input contents are limited only by the limit of the request size.
Found in the pre-release review of v0.3.0 (finding 6).
Proposed change
A much lower, configurable maximum page size for view=FULL (e.g., 64), and iterate the cursor instead of loading it as a whole.
Don't keep tasks that fail validation, or that no backend accepts: delete the document and its owner rules, and document the change in docs/upgrading.md. Tasks that a backend may have accepted (unknown outcome, fix: submit tasks to backends exactly once #274) are kept.
A separate, lower, configurable size limit for inline inputs[].content.
Docs: recommend rate limiting at the ingress for production (generic, e.g., the rate-limit annotations of the ingress controller; no deployment-specific values).
Per-user limits and retention of finished tasks are separate, opt-in features (follow-up issues).
Activity
test: assert discarded tasks and kept errors