ray icon indicating copy to clipboard operation
ray copied to clipboard

[Serve] Return 400 response code for malformed Serve configs sent via REST API

Open shrekris-anyscale opened this issue 3 years ago • 0 comments

Signed-off-by: Shreyas Krishnaswamy [email protected]

Why are these changes needed?

When users submit a malformed Serve config (e.g. with invalid fields) via PUT request, they receive a 500 error. This change makes the REST API return a 400 (unretryable) error instead.

Related issue number

Closes #31370

Checks

  • [x] I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • [x] I've run scripts/format.sh to lint the changes in this PR.
  • [ ] I've included any doc changes needed for https://docs.ray.io/en/master/.
  • [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • [x] Unit tests
      • New unit tests are added to test_serve_agent.py.

shrekris-anyscale avatar Dec 31 '22 00:12 shrekris-anyscale