Skip to content

fix(firestore-send-email): kit/extension parity – bursts of mail with attachments run the kit out of memory and the mail is never sent #3292

Closed

Description

@CorieW

firestore-send-email kit/extension parity. Priority: critical. A burst of emails with attachments runs the kit out of memory, and most of those emails are never sent. Nothing marks them as failed.

Difference

The kit's processQueue sets no runtime options, so the CLI deploys it with the 2nd gen defaults. One instance then takes up to 80 events at once in 256 MiB. Each mail event carries the whole document twice (before and after), so a few large documents arriving together are enough to go over the memory limit.

Extension 0.2.10 Kit (kits @ 1c7b047)
Concurrency 1 80
CPU 0.1666 1
Max instances 100 unset
Ingress ALLOW_INTERNAL_ONLY ALLOW_ALL

Reproduced

Extension and kit deployed side by side with the same config. 20 mail documents, each with a 300–700 KB base64 attachment, were written at once.

  • Extension: every document reached SUCCESS or ERROR, with no memory errors. 40 of 40 also finished in a 40 × 400 KB run.
  • Kit:
    • logs show Memory limit of 256 MiB exceeded and up to 44 × The request failed because either the HTTP response was malformed or connection to the instance had an error;
    • 12–17 of the 20 documents were left in PROCESSING or PENDING, or got no delivery field at all;
    • nothing retries them.
  • Install paths: the README setup, functions:kits:install and ext:migrate all reproduce it. The migrated instance keeps the extension's 256 MiB but not its concurrency of 1.
  • Fix verified: the kit built from fix(firestore-send-email): match the extension's cpu, concurrency and ingress #3233 (concurrency: 1, cpu: "gcf_gen1", internal-only ingress) took the same burst with 20 of 20 documents finishing and no memory errors.
  • Without attachments: an 80-document burst of plain mail showed no memory errors on either side.

Code

Resolution

Merge #3233, which pins concurrency: 1, cpu: "gcf_gen1" and ingressSettings: "ALLOW_INTERNAL_ONLY", and was verified live against this burst. #3206 covers the same gap across all kits but has merge conflicts.

Activity

  1. added a commit that references this issue on Nov 10, 2026
    ecf60fc
  2. self-assigned this
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions