You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
run_with_streaming_response and automatically streaming buffered responses #967
I know that right now, buffered responses will return an empty response when running with run_with_streaming_response (#805). Would it be possible (would PRs be accepted?) for some code that would intercept buffered responses and transform them to a dummy stream?
I'm currently doing this in my app because I'm sharing some error handling code between the buffered and streaming APIs, but I think it would make sense for something like this to live in the runtime. What do you think?
It's basically exactly what's in #805. I've broken up my APIs in to two Lambda functions -- one for buffered and one for streaming, and I want to reuse buffered handlers between the streaming and buffered APIs.
I investigated this to prepare a PR and wanted to share my findings.
Reproduction attempt (March 2026)
I deployed a minimal Lambda using run_with_streaming_response with buffered handlers (Body::Text) on a Function URL configured with RESPONSE_STREAM invoke mode, using the current main branch.
The empty response problem from #805 no longer reproduces. It appears the Lambda platform has resolved the underlying issue since the original report (Feb 2024).
What I verified in the code
I also traced the full code path (BodyStream::poll_next → streaming protocol → EventCompletionRequest::into_req channel) and confirmed that buffered body data flows correctly through every layer.
Question
Can anyone still reproduce empty responses with the current version? If so, I'd like to know the specific setup (Function URL vs API Gateway, Axum router vs direct handler, runtime version, etc.) so I can target a fix.
I was able to verify this using the latest lambda_http. Thanks! I'm not sure what PR exactly solved this, but this will make managing mixed streaming and buffered APIs much better. Thank you @fangkangmi for verifying on your side as well.
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
Activity
bnusunny commentedon Mar 12, 2025
I'm not quite understand your use case. Do you mind to share a sample code?
keichan34 commentedon Mar 13, 2025
It's basically exactly what's in #805. I've broken up my APIs in to two Lambda functions -- one for buffered and one for streaming, and I want to reuse buffered handlers between the streaming and buffered APIs.
bnusunny commentedon Mar 15, 2025
Got it! It will be useful to able to use response streaming mode to process both buffered and streaming functions. PR is welcome.
fangkangmi commentedon Mar 22, 2026
I investigated this to prepare a PR and wanted to share my findings.
Reproduction attempt (March 2026)
I deployed a minimal Lambda using
run_with_streaming_responsewith buffered handlers (Body::Text) on a Function URL configured withRESPONSE_STREAMinvoke mode, using the currentmainbranch.Result
Both routes returned correct, non-empty responses through the streaming Function URL:
The empty response problem from #805 no longer reproduces. It appears the Lambda platform has resolved the underlying issue since the original report (Feb 2024).
What I verified in the code
I also traced the full code path (
BodyStream::poll_next→ streaming protocol →EventCompletionRequest::into_reqchannel) and confirmed that buffered body data flows correctly through every layer.Question
Can anyone still reproduce empty responses with the current version? If so, I'd like to know the specific setup (Function URL vs API Gateway, Axum router vs direct handler, runtime version, etc.) so I can target a fix.
keichan34 commentedon Mar 23, 2026
I was able to verify this using the latest lambda_http. Thanks! I'm not sure what PR exactly solved this, but this will make managing mixed streaming and buffered APIs much better. Thank you @fangkangmi for verifying on your side as well.
github-actions commentedon Mar 23, 2026
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
fix(aws): an empty body is a buffered reply, not a sentinel byte