fix(api): dont 500 on cross dc response#4449
fix(api): dont 500 on cross dc response#4449MasterPtato wants to merge 1 commit into03-17-chore_update_byte_units_on_frontendfrom
Conversation
|
🚅 Deployed to the rivet-pr-4449 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review:
|
29a5224 to
8ee527a
Compare
d4011f0 to
3b845cb
Compare
8ee527a to
5c55237
Compare
3b845cb to
1028b2c
Compare
|
PR Review: fix(api) dont 500 on cross dc response This is a small, focused bug fix that correctly addresses the issue of cross-DC responses being converted to 500 errors. Change Summary: In reqwest_to_axum_response, when a remote DC returned a non-2xx response, anyhow::bail!() was called, which propagated as an internal server error (500) instead of forwarding the actual response status and body to the client. The fix logs the error and allows the response to pass through with its original status code. Whats Good: reqwest_to_axum_response is intended as a raw pass-through so forwarding the original status code and body is the right approach. The new tracing::error! call correctly follows the project logging conventions. The body_bytes borrow via String::from_utf8_lossy is correctly scoped within the if block. Minor Suggestions: (1) Consider using %status (Display) instead of ?status (Debug) for the status code - Display outputs 404 Not Found while Debug adds extra formatting noise. (2) tracing::error! is reasonable but tracing::warn! might reduce log noise if 404s are expected in normal operation. (3) The checklist items in the PR description are unchecked - worth filling in for completeness. Overall this is a correct and minimal fix. LGTM. |
5c55237 to
876713f
Compare
1028b2c to
88d15c3
Compare
PR Review:
|
88d15c3 to
ede07de
Compare
876713f to
3bf4304
Compare
ede07de to
e9536ed
Compare
3bf4304 to
9282590
Compare
e9536ed to
cf68e1c
Compare
9282590 to
bc5319a
Compare
PR Review:
|
bc5319a to
72b27cf
Compare
cf68e1c to
0422e8d
Compare
PR Review: fix(api): dont 500 on cross dc responseThe fix is correct and well-targeted. The Observations
tracing::error!(%status, ?ray_id, %body_text, "remote dc returned error");This would log Log level for 4xx — Logging all non-success responses at if status.is_server_error() {
tracing::error!(%status, ?ray_id, %body_text, "remote dc returned server error");
} else {
tracing::warn!(%status, ?ray_id, %body_text, "remote dc returned client error");
}That said, since this is internal DC-to-DC traffic, 4xx from a peer DC may legitimately indicate a problem worth surfacing as an error — so the current choice is defensible. Contrast with SummaryThe core fix is sound — replacing |
72b27cf to
a9b074b
Compare
a9b074b to
6e86176
Compare
1cb5f34 to
34988dd
Compare
Code Review: fix(api): dont 500 on cross dc responseSummary: The PR converts a hard Correctness / Bug FixThe fix is correct and addresses the root problem. The old code in Callers of Logging ConventionThe new log line follows the project's structured logging conventions correctly: tracing::error!(?status, ?ray_id, %body_text, "remote dc returned error");Minor nit: Potential Information LossThe old Test CoverageNo tests are added. A regression test for the cross-DC error proxy path would be valuable, specifically asserting that a non-2xx response from a remote DC is forwarded with the correct status code and body rather than converted to a 500. Summary
Overall this is a good, targeted fix. The main actionable suggestion is to consider changing |
6e86176 to
90bceb5
Compare
34988dd to
388ad2e
Compare

Fixes RVT-6105
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: