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

fix(pageserver): receive body error now 500 #9052

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

skyzh
Copy link
Member

@skyzh skyzh commented Sep 18, 2024

Problem

close #8903

In #8903 we observed JSON decoding error to have the following error message in the log:

Error processing HTTP request: Resource temporarily unavailable: 3956 (pageserver-6.ap-southeast-1.aws.neon.tech) error receiving body: error decoding response body

This is hard to understand. In this patch, we make the error message more reasonable.

Summary of changes

  • receive body error is now an internal server error, passthrough the reqwest::Error as anyhow::Error.
  • instead of formatting the error using to_string, we use the alternative anyhow::Error formatting, so that it prints out the cause of the error (i.e., what exactly cannot serde decode).

I would expect seeing something like error receiving body: error decoding response body: XXX field not found after this patch, though I didn't set up a testing environment to observe the exact behavior.

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

  • Do not forget to reformat commit message to not include the above checklist

@skyzh skyzh requested a review from a team as a code owner September 18, 2024 19:30
@skyzh skyzh requested a review from jcsp September 18, 2024 19:30
Signed-off-by: Alex Chi Z <[email protected]>
Copy link

github-actions bot commented Sep 18, 2024

4968 tests run: 4804 passed, 0 failed, 164 skipped (full report)


Flaky tests (4)

Postgres 17

Postgres 16

Postgres 15

  • test_ondemand_wal_download_in_replication_slot_funcs: release-x86-64

Code coverage* (full report)

  • functions: 31.9% (7424 of 23301 functions)
  • lines: 49.8% (59741 of 119910 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
3b39f86 at 2024-09-19T20:07:17.798Z :recycle:

@skyzh skyzh changed the title impr(pageserver): receive body error now 500 fix(pageserver): receive body error now 500 Sep 19, 2024
@skyzh skyzh requested a review from jcsp September 19, 2024 19:09
@skyzh
Copy link
Member Author

skyzh commented Sep 19, 2024

added a commit to only return 500 for decoding errors; for other reqwest errors, also log the error source

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.

pageserver API client interprets JSON syntax errors as 503
2 participants