Skip to content

docs(hips): Body::poll_progress - #4265

Open
cratelyn wants to merge 7 commits into
hyperium:masterfrom
cratelyn:kate/body-poll-progress-hip
Open

cratelyn wants to merge 7 commits into
hyperium:masterfrom
cratelyn:kate/body-poll-progress-hip

Conversation

@cratelyn

@cratelyn cratelyn commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Rendered

this branch contains HIP-0002. this improvement proposal advocates for the addition of a new provided method to the http_body::Body trait. see the attached proposal for more information.

Important

Please make line comments, instead of comments on the PR as a whole. It makes discussion much easier to keep untangled.

@cratelyn cratelyn self-assigned this Nov 12, 2026
@cratelyn cratelyn added A-docs Area: documentation. C-feature Category: feature. This is adding a new feature. A-body Area: body streaming. labels Nov 12, 2026
@cratelyn
cratelyn force-pushed the kate/body-poll-progress-hip branch 5 times, most recently from e6a5fd0 to 3355ea1 Compare November 13, 2026 22:15
@sfackler

Copy link
Copy Markdown
Contributor

Thanks for writing this up! Excited to see this start to move forward :)


```rust
while let Some(frame) = body.frame().await? {
// what if body (^) cancels while we wait here?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

gRPC client cancellation runs into this. Downstream issue with a repro: grpc/grpc-rust#2983. tonic cancels a call by failing the request body, but while hyper waits for flow-control capacity it doesn't poll the body, so the cancel is never seen and no RST_STREAM goes out. The server keeps the stream open until the window reopens or the connection closes. poll_progress would let tonic report the cancel while hyper waits.

this commit introduces the initial draft of a HIP that proposes the
addition of a new trait method, called `poll_progress()`, to the `Body`
trait.

Signed-off-by: katelyn martin <git@katelyn.world>
Signed-off-by: katelyn martin <git@katelyn.world>
these were two alternate signatures previously listed under "Unresolved
Questions" that were discussed in a review thread here:

<hyperium#4265 (comment)>

as these questions have now been resolved, we can move this to the
section further down outlining alternatives.

Signed-off-by: katelyn martin <git@katelyn.world>
this adds more writing to the User Experience, Security Considerations,
and Implementation sections of the HIP template.

Signed-off-by: katelyn martin <git@katelyn.world>
@cratelyn
cratelyn force-pushed the kate/body-poll-progress-hip branch from 4dea2e0 to 5767189 Compare November 30, 2026 19:47
Signed-off-by: katelyn martin <git@katelyn.world>
@cratelyn
cratelyn marked this pull request as ready for review November 30, 2026 20:02
the name for this proposed interface seems to be generally agreed upon
at this point. move this section down to "Alternatives".

Signed-off-by: katelyn martin <git@katelyn.world>
docs/TENETS.md includes some project-level tenets. this commit
introduces some hip-level tenets outlining the concerns in mind when
designing this new interface.

Signed-off-by: katelyn martin <git@katelyn.world>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

in a previous thread, we discussed the tradeoffs between using Poll<Result<(), E>> and Poll<Result<Infallible, E>> as two potential return types for this method. as promised, i have now reworked this document to suggest using Infallible, because it has worthwhile upsides.

i have additionally added more information regarding the tenets, implementation plan, and user experience for this feature. sections previously describing "unresolved" questions have been moved into "alternatives" for questions that now appear to be resolved.

i think that this is now ready for another round of review. as always, i appreciate anybody's time and effort to review this proposal. thank you 🙂

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-body Area: body streaming. A-docs Area: documentation. C-feature Category: feature. This is adding a new feature.

4 participants