Skip to content

fix(cli): Show oversized drops that finish after a session closes - #2400

Open
sentry-junior[bot] wants to merge 3 commits into
mainfrom
fix/local-oversized-close
Open

sentry-junior[bot] wants to merge 3 commits into
mainfrom
fix/local-oversized-close

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2347.

If a session closed while an ingest request was still being read, the request could still end in a 413, but by then the stream had already sent retained and ended. So the tail never printed the oversized-envelope warning.

Now the session waits for requests it already started reading before it sends the closing frame. A late request is still never saved: it gets 413 if it's too big, and 410 otherwise. Requests that arrive after the close still get 410 right away. The size limits stay the same: 10 MiB encoded, 32 MiB decoded.

Before

POST …/ingest   1 byte, session closes, then >10 MiB   -> 413
stream:  … session {"state":"retained"}   (no warning)

After

POST …/ingest   same                                    -> 413
stream:  … event: sentry.local.oversized
         session {"state":"retained"}

One tradeoff: a client that stalls in the middle of a body now holds back the closing frame until its body finishes or the connection drops.

via @MathurAditya724.

--

View Session [Sentry]

A request that was still being read when a session closed could end in
a 413 after the stream had already sent its closing frame, so the tail
never warned about the dropped envelope. The session now drains requests
it started reading, so the oversized notice comes first. Decoding still
runs after close to apply the 32 MiB limit, and nothing is retained.

Co-Authored-By: Aditya Mathur <57684218+MathurAditya724@users.noreply.github.com>
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Nov 18, 2026 10:17pm UTC
sentry-local Ready Ready Preview Nov 18, 2026 10:17pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 18, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3dff459. Configure here.

The closed check ran after decoding, so a body that had fully arrived
before close but was still queued or decoding got 410 and was dropped.
Check whether the session is closed when the body finishes arriving
instead, and still apply the size limits first.
…lose

# Conflicts:
#	packages/cli/src/commands/local/receiver-ingest.ts

This branch was successfully deployed

2 active and 1 inactive (outdated) deployments
Preview – sentry-local — a9e72894 Deployed Nov 18, 2026 by vercel[bot]
Preview – cli — a9e72894 Deployed Nov 18, 2026 by vercel[bot]
Preview — 3307947b Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant