Skip to content

Sending local reply with status code 502 for request dropped by drop_overload#31681

Closed
yanjunxiang-google wants to merge 1 commit intoenvoyproxy:mainfrom
yanjunxiang-google:drop_overload_badgateway
Closed

Sending local reply with status code 502 for request dropped by drop_overload#31681
yanjunxiang-google wants to merge 1 commit intoenvoyproxy:mainfrom
yanjunxiang-google:drop_overload_badgateway

Conversation

@yanjunxiang-google
Copy link
Contributor

@yanjunxiang-google yanjunxiang-google commented Jan 7, 2024

Sending local reply with status code 502 (BAD_GATEWAY) instead of 503(SERVICE_UNAVAILABLE)for request dropped by drop_overload.

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

…ropped by DROP_OVERLOAD

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
@yanjunxiang-google yanjunxiang-google changed the title Sending local reply with status code 503 request dropped by drop_overload Sending local reply with status code 503 for request dropped by drop_overload Jan 7, 2024
@yanjunxiang-google yanjunxiang-google changed the title Sending local reply with status code 503 for request dropped by drop_overload Sending local reply with status code 502 for request dropped by drop_overload Jan 7, 2024
@yanjunxiang-google
Copy link
Contributor Author

This is a follow up commit for #30827.

@yanjunxiang-google
Copy link
Contributor Author

/assign @adisuissa @yanavlasov

Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

Thanks!
Left a high-level question.
/wait-any

Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

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

sorry, forgot to press the "start review" button

ENVOY_STREAM_LOG(debug, "The request is dropped by DROP_OVERLOAD", *callbacks_);
callbacks_->streamInfo().setResponseFlag(StreamInfo::ResponseFlag::DropOverLoad);
chargeUpstreamCode(Http::Code::ServiceUnavailable, nullptr, true);
chargeUpstreamCode(Http::Code::BadGateway, nullptr, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

According to the RFC 503 definition of 503:

... indicates that the server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.

which seems like a better fit, no?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants