Skip to content

perf API endpoint does not handle problematic inputs gracefully #962

Open
@pnkfelix

Description

@pnkfelix

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-apiIssues related to the API exposed by the siteC-bugA bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions