ray
ray copied to clipboard
[Serve] Return 400 response code for malformed Serve configs sent via REST API
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.shto 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.
- New unit tests are added to
- [x] Unit tests