Repository navigation
Report raw-request HTTP errors as failed requests - #152
Merged
Merged
Conversation
SolrClient.raw_request returns the response without checking its status, and RawRequest never checked it either, so a 4xx or 5xx from Solr was recorded as a successful operation. RawRequest is now a SolrRunner and raises for error statuses, so the existing translation turns them into BenchmarkTransportError and the sample is recorded as an error with its http-status.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change aligning raw-request HTTP error reporting with other Solr runners.
No open issues 🎉
What changed in this PR
This PR makes raw-request report HTTP errors as failed benchmark requests, aligning its behavior with other Solr runners instead of understating error rates.
Changes:
- Makes
RawRequestinherit fromSolrRunnerand check response status, enabling existing error translation for 4xx and 5xx responses. - Adds tests for successful 200 responses and exception translation for 500 and 404 responses.
| File | Description |
|---|---|
tests/unit/solr/test_runner.py |
Adds regression tests for raw-request success and HTTP error handling. |
solrorbit/worker_coordinator/runner.py |
Routes raw-request HTTP failures through standard Solr error handling and documents the behavior. |
Review effort: Balanced
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
raw-requestreports every request as successful, whatever Solr answers.SolrClient.raw_requestreturns therequests.Responsewithout checking the status.SolrSearchcallsresp.raise_for_status()itself for this reason, butRawRequestdoesn't. It also isn't aSolrRunner, so it has no error translation. A 400, 404 or 500 comes back as{"weight": 1, "http-status": 500, ...}with nosuccesskey, andexecute_singlethen records it as a success. The error rate stays at 0 and the failing request's latency is reported as normal.On
solr:9,GET /api/collections/nopeandPOST /api/collectionswith an invalid body both return 500, and both were reported as successful operations.This also affects converted workloads.
convert-workloadkeepsraw-requestoperations as they are, so the convertedelb_logsworkload still sendsPOST /elb_logs/_flushandPOST /_plugins/_ppl(thet1-*PPL tasks). Solr answers those with 404, and today they are timed as successful requests.The fix:
RawRequestnow extendsSolrRunnerand callsresp.raise_for_status().HTTPErrorinto aBenchmarkTransportError, orBenchmarkNotFoundErrorfor a 404.success: Falsewithhttp-statusand an error description, the same as the other runners. With the default--on-error continuethe run carries on.Successful requests are unchanged. One behaviour change to note: workloads that send OpenSearch-only paths through
raw-requestwill now show those tasks as errors instead of hiding them.Issues Resolved
None filed. I found it while reading the runner.
Testing
New
TestRawRequestintests/unit/solr/test_runner.py:http-statusandweight.BenchmarkTransportErrorwithstatus_code500.BenchmarkNotFoundError.The 500 and 404 tests fail on
main.I also ran it against
solr:9throughexecute_singlewithon_error="continue":GET /api/collections/nopenow gives{'success': False, 'error-type': 'transport', 'http-status': 500, ...}with 0 ops, where it used to be a success.GET /api/collectionsis stillsuccess: True.The full
tests/suite passes locally on Python 3.13 (1178 passed, 5 skipped), and so doesruff check ..By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.