rust-lang / rust-lang/rustc-perf
perf API endpoint does not handle problematic inputs gracefully
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 732
- Forks
- 189
- Avg merge
- 10h 52m
- Merged PRs (30d)
- 43
Description
I often try to be too clever and write things like this:
% PARENT=3354a44d2fa8d5ba6b8d6b40d2596de2c8292ec1 curl https://perf.rust-lang.org/perf/triage -d "{\"start\": \"$PARENT\"}"
The problem is that the above ends up shell-expanding into the equivalent of this:
% curl https://perf.rust-lang.org/perf/triage -d '{"start": ""}'
and then the server spins its wheels for a while before finally responding with this:
<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
</body>
</html>
Can we do better here? E.g., could we respond with a page that says "the triage script wasn't able to process your request, which, by the way, looked like this: { "start": "" }?
(Obviously its my responsibility to know how to use the shell properly. But the above Gateway time out message makes it a lot harder for me to recognize that the fault definitely lies with how I invoked it.)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the /perf/triage endpoint and reproduce the request with an empty "start" value using the curl example. Trace how the request is validated and handled; done means malformed input returns a prompt client-visible error instead of a gateway timeout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100