Skip to content

Ship lean project and user contexts in queue messages instead of whole documents #14478

Closed

Description

@ChiragAgg5k

Tracks PR #14477.

Plan

  • Goal: Stop queue messages from carrying whole project and user documents (and the full audit response payload), so a single oversized job can't OOMKill workers again. Per the PR, on 2026-10-13 a ~138MB v1-audits job sat in the queue for 14h and OOMKilled every worker-audits pod that reserved it (~360 restarts).
  • What changes (all in fix(queue): ship lean project and user contexts instead of whole documents #14477):
    • New src/Appwrite/Event/Message/UserContext.php ($id, $sequence, name, email, type); ProjectContext.php gains database.
    • Messages under src/Appwrite/Event/Message/ (Build, Func, Mail, Messaging, Database, Delete, Jobs, Migration, Execution(s), ExecutionCancelled, StatsResources, Audit) send ProjectContext / UserContext instead of full documents; Database and Messaging drop user entirely.
    • app/controllers/shared/api.php and src/Appwrite/Platform/Modules/S3/Http/S3/Base.php: audit payload defaults off / sends [].
    • app/init/worker/message.php: workers resolve the console project from config, not the payload.
    • New src/Appwrite/Utopia/Queue/Publisher/Telemetry.php: queue.payload.size histogram per queue, warning above 1MB (no rejection).
    • Unit tests in tests/unit/Event/Message/ and a pinned domain in tests/unit/Workers/CertificatesDomainValidationTest.php.
    • PR benchmark: document-carrying queues drop from ~147 GiB/day to ~22 GiB/day (85%); old-format in-flight jobs still decode.
  • Remaining steps:
    1. Get fix(queue): ship lean project and user contexts instead of whole documents #14477 reviewed and merged, watching the E2E suites the PR lists (Functions, Webhooks, Databases/TablesDB, Messaging, Account, Teams, Migrations, Projects, Realtime, Usage).
    2. Ship the cloud follow-up in appwrite-labs/cloud together with the server-ce bump, as the PR says it must: drop user: from DatabaseMessage in the four Delete.php actions, return the injected console project in cloud's worker message.php, wrap cloud publishers with the size decorator, and trim cloud messages (threats, growth, ZDT, dedicated databases).
    3. Release and deploy, then watch the queue.payload.size metric and worker-audits restarts.
  • Done when:

Update 2026-10-14

Activity

  1. self-assigned this
    on Oct 14, 2026
  2. added
    product / console
    product / databases
    product / domains
    product / messaging
    product / sites
    on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

product / consoleproduct / databasesproduct / domainsproduct / messagingproduct / sites

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions