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

golang filter returns with unexpected response code when the payload exceeds its buffer limit size #34115

Closed
ardikabs opened this issue May 13, 2024 · 3 comments · Fixed by #34240

Comments

@ardikabs
Copy link

Title: golang filter returns with unexpected response code when the payload exceeds its buffer limit size

Description:
In the EncodeData phase, if the response payload exceeds the buffer limit size, the GoLang filter currently responds with a 413 error (Payload Too Large). This can be misleading as it suggests an error related to the client's request, which ideally 4xx errors are associated with downstream issues.

Additional Information:
Tested in v1.29.4, as the code is also present in the latest release, it remains applicable.

Related codes:

if (state_ == FilterState::WaitingAllData) {
// On the request path exceeding buffer limits will result in a 413.
ENVOY_LOG(debug, "golang filter encode data buffer is full, reply with 413");
encoder_callbacks_->sendLocalReply(
Http::Code::PayloadTooLarge,
Http::CodeUtility::toString(Http::Code::PayloadTooLarge), nullptr, absl::nullopt,
StreamInfo::ResponseCodeDetails::get().RequestPayloadTooLarge);
return;
}

Slack discussion: https://envoyproxy.slack.com/archives/C04QNSXC7U0/p1715513921673679?thread_ts=1715440619.442059&cid=C04QNSXC7U0

cc @doujiang24

@ardikabs ardikabs added bug triage Issue requires triage labels May 13, 2024
@doujiang24
Copy link
Member

Thanks @ardikabs it’s a bug.
the response status should be 500, same as filter manager here: https://github.com/envoyproxy/envoy/blob/main/source/common/http/filter_manager.cc#L1782-L1784

@ravenblackx ravenblackx added area/http_filter area/golang and removed triage Issue requires triage labels May 14, 2024
@ravenblackx
Copy link
Contributor

@doujiang24 what's the intended state of this? Are you fixing it? Are you suggesting the reporter might fix it? Should it be "help wanted"?

@doujiang24
Copy link
Member

Thanks @ravenblackx , I'll fix it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants