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

add interval check for payload pending #2032

Closed
wants to merge 26 commits into from

Conversation

fakeshadow
Copy link
Contributor

@fakeshadow fakeshadow commented Feb 27, 2021

PR Type

Feature

PR Checklist

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

Overview

Add interval check(1 second) on Io stream's read status when response payload stream enters pending.
When interval check detect Io is not readable anymore it would assume remote client have disconnect and end dispatcher. All unfinished responses would be lost.

Closes #1313

@fakeshadow
Copy link
Contributor Author

fakeshadow commented Mar 2, 2021

Draft this for now until finding a way to detect client disconnect

@fakeshadow fakeshadow marked this pull request as draft March 2, 2021 23:27
@fakeshadow fakeshadow marked this pull request as ready for review March 23, 2021 11:02
@fakeshadow
Copy link
Contributor Author

Should this active across aboard or put behind a feature gate?

@robjtede
Copy link
Member

What's the rationale for wanting a feature flag? You expect a perf hit?

@fakeshadow
Copy link
Contributor Author

I suspect this could conflict with user keep alive code like a longer heartbeat they define with extra logic on heartbeat expire. This could end the connection before their heartbeat logic kick in hense breaking.

I'm not sure about this though just a guess.

@kmyers608
Copy link

Is there anything I can help with to move this forward? We believe that this issue is the root cause behind an issue we have been running into running actix behind envoy.

@fakeshadow
Copy link
Contributor Author

fakeshadow commented Apr 1, 2021

Is there anything I can help with to move this forward? We believe that this issue is the root cause behind an issue we have been running into running actix behind envoy.

Thanks for asking.

I want to make a bit clearify that this PR is not an issue fix but mostly a feature(a hacky one).

The problem of this feature is it goes against convensional handing of Rust future/stream type and may cause problem for people expecting otherwise. Like this #2032 (comment) discussed.

It would be pretty hard to test the possibility of break people code so I tend to give this PR sometime and potentially make it a gated feature that is opt-in.

Edit: It would be appreciated to help test and/or help putting this behind a feature. I would try to keep this PR in sync with master

@robjtede robjtede added this to the actix-web post-v4 milestone Apr 22, 2021
@fakeshadow
Copy link
Contributor Author

I don't have time to keep up the sync with master branch anymore.
This PR would be left where it's now and anyone feel like to can pick it up or make a new one for the same feature.

@fakeshadow fakeshadow marked this pull request as draft May 29, 2021 02:10
@fakeshadow fakeshadow closed this May 29, 2021
@fakeshadow fakeshadow deleted the feature/h1_pending_timer branch May 30, 2021 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-http project: actix-http B-semver-norelease change that does not require a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A Stream object in a pending state won't be dropped after the client disconnect
3 participants