Skip to content

server: include request body receipt in the request deadline #136

@iainmcgin

Description

@iainmcgin

For unary and server-streaming RPCs the request body is collected before the deadline wrapper is applied (collect_body_limited runs ahead of the tokio::time::timeout call in connectrpc/src/service.rs), so a configured DeadlinePolicy bounds only handler execution, not the time spent receiving the request. A request that sends headers and then delivers its body very slowly holds the request future for as long as the connection stays open, regardless of policy. Client-streaming and bidi RPCs are not affected because the body is read inside the handler.

Proposed work: start the deadline clock before body collection (or wrap the body read in the same timeout), so that with_default_timeout / with_max bound the whole request. Worth doing together with the connection-level timeout work, since with the default no-op policy there is currently no time bound at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions