Skip to content

http_body example is not working with large body #326

@manXcoder

Description

@manXcoder

I tried to capture the full request body as shown in the example, but the last chunk of data is always missing.
The total body size is 73,072 bytes, but I can only receive 65,500 bytes — the last 7,572 bytes are lost.

Eventually, I worked around this by make a custom cache to store each chunk in on_http_request_body till the _end_of_stream is true.

The full istio log:
2025-08-11T03:14:52.856058Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1898 [Tags: "ConnectionId":"611224"] Http2Visitor::OnFrameHeader(3, 16375, 0, 0) thread=22
2025-08-11T03:14:52.856063Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1950 [Tags: "ConnectionId":"611224"] Http2Visitor::OnBeginDataForStream(3, 16375) thread=22
2025-08-11T03:14:52.856066Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1962 [Tags: "ConnectionId":"611224"] Http2Visitor: remaining data payload: 16375, end_stream: false thread=22
2025-08-11T03:14:52.856073Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1991 [Tags: "ConnectionId":"611224"] Http2Visitor dispatching DATA for stream 3 thread=22
2025-08-11T03:14:52.858477Z debug envoy router external/envoy/source/common/router/router.cc:738 [Tags: "ConnectionId":"611224","StreamId":"841103180158735629"] router decoding headers:
2025-08-11T03:14:52.858509Z debug envoy router external/envoy/source/common/router/upstream_request.cc:588 [Tags: "ConnectionId":"611224","StreamId":"841103180158735629"] pool ready thread=22
2025-08-11T03:14:52.895524Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1898 [Tags: "ConnectionId":"611224"] Http2Visitor::OnFrameHeader(3, 16375, 0, 0) thread=22
2025-08-11T03:14:52.895555Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1950 [Tags: "ConnectionId":"611224"] Http2Visitor::OnBeginDataForStream(3, 16375) thread=22
2025-08-11T03:14:52.895559Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1962 [Tags: "ConnectionId":"611224"] Http2Visitor: remaining data payload: 16375, end_stream: false thread=22
2025-08-11T03:14:52.895567Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1991 [Tags: "ConnectionId":"611224"] Http2Visitor dispatching DATA for stream 3 thread=22
2025-08-11T03:14:52.895659Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1898 [Tags: "ConnectionId":"611224"] Http2Visitor::OnFrameHeader(3, 16375, 0, 0) thread=22
2025-08-11T03:14:52.895666Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1950 [Tags: "ConnectionId":"611224"] Http2Visitor::OnBeginDataForStream(3, 16375) thread=22
2025-08-11T03:14:52.895669Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1962 [Tags: "ConnectionId":"611224"] Http2Visitor: remaining data payload: 16375, end_stream: false thread=22
2025-08-11T03:14:52.895674Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1991 [Tags: "ConnectionId":"611224"] Http2Visitor dispatching DATA for stream 3 thread=22
2025-08-11T03:14:52.934725Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1898 [Tags: "ConnectionId":"611224"] Http2Visitor::OnFrameHeader(3, 16375, 0, 0) thread=22
2025-08-11T03:14:52.934749Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1950 [Tags: "ConnectionId":"611224"] Http2Visitor::OnBeginDataForStream(3, 16375) thread=22
2025-08-11T03:14:52.934753Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1962 [Tags: "ConnectionId":"611224"] Http2Visitor: remaining data payload: 16375, end_stream: false thread=22
2025-08-11T03:14:52.934759Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1991 [Tags: "ConnectionId":"611224"] Http2Visitor dispatching DATA for stream 3 thread=22
2025-08-11T03:14:52.934828Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1898 [Tags: "ConnectionId":"611224"] Http2Visitor::OnFrameHeader(3, 7572, 0, 1) thread=22
2025-08-11T03:14:52.934832Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1950 [Tags: "ConnectionId":"611224"] Http2Visitor::OnBeginDataForStream(3, 7572) thread=22
2025-08-11T03:14:52.934834Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1962 [Tags: "ConnectionId":"611224"] Http2Visitor: remaining data payload: 7572, end_stream: true thread=22
2025-08-11T03:14:52.934838Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:1998 [Tags: "ConnectionId":"611224"] Http2Visitor: remaining data payload: 0, end_stream: true thread=22
2025-08-11T03:14:52.934842Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:2003 [Tags: "ConnectionId":"611224"] Http2Visitor::OnEndStream(3) thread=22
2025-08-11T03:14:52.934846Z debug envoy http2 external/envoy/source/common/http/http2/codec_impl.cc:2008 [Tags: "ConnectionId":"611224"] Http2Visitor dispatching DATA for stream 3 thread=22
2025-08-11T03:14:52.934852Z debug envoy http external/envoy/source/common/http/conn_manager_impl.cc:1130 [Tags: "ConnectionId":"611224","StreamId":"841103180158735629"] request end stream thread=22

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions