Closed Bug 1203551 Opened 9 years ago Closed 8 years ago

Requests to "/jobs/?count=2000&result_set_id__in=&return_type=list" should not return HTTP 200

Categories

(Tree Management :: Treeherder: API, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: KWierso)

References

Details

Attachments

(1 file)

Bug 1203518 was caused by thousands of requests to: https://treeherder.mozilla.org/api/project/try/jobs/?count=2000&result_set_id__in=&return_type=list We should make it: (a) fail earlier, to reduce perf hit (b) Return a 400, not a 200. ``` GET /api/project/try/jobs/?count=2000&result_set_id__in=&return_type=list HTTP 200 OK Content-Type: application/json Vary: Accept Allow: GET, POST, HEAD, OPTIONS { "meta": { "count": 2000, "repository": "try", "offset": 0 }, "results": [] } ```
The perf hit from queries like these has now been significantly reduced as of bug 1221064. However we should leave this bug open to stop it from returning an HTTP 200 - since it's not a valid search query.
Priority: P1 → P3
Summary: Requests to "/jobs/?count=2000&result_set_id__in=&return_type=list" should fail early → Requests to "/jobs/?count=2000&result_set_id__in=&return_type=list" should not return HTTP 200
Comment on attachment 8762911 [details] [treeherder] KWierso:1203551 > mozilla:master Similar to bug 1221485, but for the jobs endpoint.
Attachment #8762911 - Flags: review?(emorley)
Assignee: nobody → wkocher
Attachment #8762911 - Flags: review?(emorley) → review?(cdawson)
Comment on attachment 8762911 [details] [treeherder] KWierso:1203551 > mozilla:master Wes: what you've done so far (except a little nit and a lint error) looks great. But would you be up for doing as Ed suggested with the limit property? It would be nice to move to this.
Attachment #8762911 - Flags: review?(cdawson) → review+
Commit pushed to master at https://github.com/mozilla/treeherder https://github.com/mozilla/treeherder/commit/7d62a4b38bb68c635c48a06da0cf527d89247ad7 Bug 1203551 - Don't allow count to exceed MAX_JOBS_COUNT in the jobs api (#1594) r=camd
Landed without the change to DRF because datasource makes that difficult.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Blocks: 1190477
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: