Skip to content

fix(http,web): correctly drop web::Data on graceful shutdown#4033

Open
JohnTitor wants to merge 1 commit intoactix:mainfrom
JohnTitor:web-data-drop
Open

fix(http,web): correctly drop web::Data on graceful shutdown#4033
JohnTitor wants to merge 1 commit intoactix:mainfrom
JohnTitor:web-data-drop

Conversation

@JohnTitor
Copy link
Copy Markdown
Member

PR Type

PR_TYPE

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

Fix #3100

Fixes a web::Data leak during graceful shutdown when requst is still sending a slow request body.

I think the leak happened because a late-dropping HttpRequest could return itself to HttpRequestPool after AppInitService had already been dropped. That could keep application data alive indefinitely.

This disables the request pool when AppInitService is dropped. It also wakes HTTP/1 payload receivers with an incomplete-payload error when their sender is dropped before EOF, so body readers do not stay pending during shutdown.

@github-actions github-actions Bot added A-http project: actix-http A-web project: actix-web labels Apr 19, 2026
@JohnTitor JohnTitor force-pushed the web-data-drop branch 2 times, most recently from 98ab19e to fc0b5ef Compare April 19, 2026 05:27
@github-actions github-actions Bot added the A-multipart project: actix-multipart label Apr 19, 2026
@JohnTitor JohnTitor marked this pull request as ready for review April 20, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-http project: actix-http A-multipart project: actix-multipart A-web project: actix-web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web::Data leaks when a slow request is ongoing during graceful shutdown

1 participant