Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consume complete message body even on error #3454

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gschulze
Copy link

PR Type

Bug Fix

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

Currently, if there is an error during an HTTP request, the message body is not completely consumed in actix-web/src/types/payload.rs. In cases where HTTP keep-alive is enabled, this causes the connection to hang in the CLOSE-WAIT state, with the TCP receive queue still containing some bytes that need to be consumed. This PR modifies the Future implementation for HttpMessageBody to always consume all available data and return with success or error at the end. Besides issue #3182, there might be similar issues that are resolved by this PR.

Closes #3182

@gschulze gschulze force-pushed the bugfix/always-consume-message-body branch 2 times, most recently from 2181642 to b498c65 Compare August 16, 2024 18:29
@gschulze gschulze force-pushed the bugfix/always-consume-message-body branch from b498c65 to 7da7390 Compare September 1, 2024 11:57
@gschulze
Copy link
Author

gschulze commented Sep 6, 2024

Hey @robjtede, what are your thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connections hang in CLOSE-WAIT state
1 participant