Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle raw response exceptions #1805

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

b-deam
Copy link
Member

@b-deam b-deam commented Nov 21, 2023

Some runners set the context manager to return a 'raw' response to avoid the unnecessary client side overhead of deserialising the response body. For example, the Bulk runner selectively parses the response body to check whether the overall HTTP request contains any failed bulk items, but discards the rest of the body.

This works well for failures within the bulk request, but it doesn't solve for situations where the entire request fails. The recent Wikipedia track has been encountered difficult and vague errors during execution that look like this:


2023-11-21 01:01:28,169 -not-actor-/PID:15028 elastic_transport.transport INFO PUT https://10.10.12.39:9200/_bulk [status:413 duration:0.429s]

Running initial-documents-indexing                                             [  0% done]
[ERROR] Cannot race. Error in load generator [0]
        Cannot run task [initial-documents-indexing]: Request returned an error. Error type: api, Description: <_io.BytesIO object at 0xffff99199cb0>

Even if detailed-results: true is set for the operation, we still get back the above vague error message that is including a string literal representation of the error body.

This commit ensures that we properly handle raw request exceptions, and those that return empty bodies. Testing with the Wikipedia track (as above) now returns:

Running initial-documents-indexing                                             [  0% done]
[ERROR] Cannot race. Error in load generator [0]
        Cannot run task [initial-documents-indexing]: Request returned an error. Error type: api, Description: None, HTTP Status: 413

@b-deam b-deam added bug Something's wrong :Usability Makes Rally easier to use :Load Driver Changes that affect the core of the load driver such as scheduling, the measurement approach etc. labels Nov 21, 2023
@b-deam b-deam requested a review from a team November 21, 2023 01:29
@b-deam b-deam self-assigned this Nov 21, 2023
@b-deam b-deam added this to the 2.x milestone Dec 4, 2023
Copy link

@dpifke-elastic dpifke-elastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@b-deam b-deam merged commit 8a688f4 into elastic:master Dec 5, 2023
15 checks passed
@gareth-ellis gareth-ellis modified the milestones: 2.x, 2.11 May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's wrong :Load Driver Changes that affect the core of the load driver such as scheduling, the measurement approach etc. :Usability Makes Rally easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants