Skip to content

fix: release HTTP request buffers after chunk-limit rejection - #8996

Merged
pskiran1 merged 6 commits into
mainfrom
spolisetty_test_http
Oct 8, 2026
Merged

pskiran1 merged 6 commits into
mainfrom
spolisetty_test_http

Conversation

@pskiran1

@pskiran1 pskiran1 commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

What does the PR do?

Requests exceeding the HTTP chunk limit could retain accumulated body buffers and continue into inference handling after HTTP 400 was queued, causing excessive RSS growth across repeated rejected requests.
This change releases the accumulated body on rejection, discards remaining body fragments processed from already received bytes, and prevents dispatch of requests whose response is already marked finished.
The chunk limit and existing test criteria remain unchanged.

Checklist

  • PR title reflects the change and is of format <commit_type>: <Title>
  • Changes are described in the pull request.
  • Related issues are referenced.
  • Populated github labels field
  • Added test plan and verified test passes.
  • Verified that the PR passes existing CI.
  • Verified copyright is correct on all changed files.
  • Added succinct git squash message before merging ref.
  • All template sections are filled out.
  • Optional: Additional screenshots for behavior/output changes with before/after.

Commit Type:

  • build
  • ci
  • docs
  • feat
  • fix
  • perf
  • refactor
  • revert
  • style
  • test

Related PRs: #8770

Where should the reviewer start?

Test plan:

  • CI Pipeline ID: 72440627

Caveats:

Background

#8770

Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
@pskiran1
pskiran1 marked this pull request as ready for review October 4, 2026 09:21
@pskiran1
pskiran1 marked this pull request as draft October 4, 2026 09:21
@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Fixes memory leak in HTTP request handling when chunk limit is exceeded.

The PR appears safe to merge based on the reviewed changes.

Summary

This PR releases accumulated HTTP request-body data when the chunk limit is exceeded, discards body fragments already buffered by the parser, and prevents a rejected request from reaching normal dispatch.

  • The only change since the previous review reformats a test import.
  • The chunk limit and test criteria remain unchanged.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Chunk count exceeds limit] --> B[Drain accumulated body]
  B --> C[Discard buffered fragments]
  C --> D[Queue HTTP 400 and stop reads]
  D --> E[Skip normal dispatch]
Loading

Reviews (4) · Last reviewed commit: "Fix pre-commit error" · Reviewed by Greptile

Comment thread src/http_server.cc
@mc-nv
mc-nv marked this pull request as ready for review October 5, 2026 15:22
@mc-nv
mc-nv marked this pull request as draft October 5, 2026 15:22
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
@pskiran1
pskiran1 marked this pull request as ready for review October 8, 2026 15:58
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
@pskiran1 pskiran1 added the PR: fix A bug fix label Oct 8, 2026
@pskiran1
pskiran1 merged commit 5658dcf into main Oct 8, 2026
4 checks passed
@pskiran1
pskiran1 deleted the spolisetty_test_http branch October 8, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix A bug fix

Development

Successfully merging this pull request may close these issues.

3 participants