Skip to content

Refactor some runners to set transport level options#1705

Merged
dliappis merged 1 commit intoelastic:masterfrom
b-deam:set-transport-options
Apr 19, 2023
Merged

Refactor some runners to set transport level options#1705
dliappis merged 1 commit intoelastic:masterfrom
b-deam:set-transport-options

Conversation

@b-deam
Copy link
Copy Markdown
Member

@b-deam b-deam commented Apr 18, 2023

With this commit we fix a bug that prevented any runner using the low
level perform_request() ES client method, and _transport_request_params()
helper method from passing in the request-timeout parameter.

Relates #1673
Relates elastic/rally-tracks#393

Note that there's still follow up work to be done to refactor the remaining runners, specifically around overriding the client's options() method to handle the distribution_version param to support REST compatibility headers as discussed in #1673, but that will only affect us when 9.x is released.

@b-deam b-deam added the bug Something's wrong label Apr 18, 2023
@b-deam b-deam requested review from dliappis and pquentin April 18, 2023 03:09
@b-deam b-deam self-assigned this Apr 18, 2023
@b-deam b-deam added this to the 2.8.0 milestone Apr 18, 2023
Copy link
Copy Markdown
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good to me.

Copy link
Copy Markdown
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

LGTM from me too, thanks for the quick turnaround.

if (ignore_status := request_params.pop("ignore", None)) or (ignore_status := params.pop("ignore", None)):
transport_params["ignore_status"] = ignore_status

headers = params.pop("headers", None) or {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For my own curiosity: there is a possibility that the headers key exists but is not a dict, hence we need to do the or {} instead of just params.pop("headers", {})?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something's wrong

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants