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

Fix request timeout handling #943

Merged

Conversation

danielmitterdorfer
Copy link
Member

With this commit we address several issues in request timeout handling:

  1. We ensure that the end of the request is properly measured
  2. We set an explicit request timeout on the connection to avoid that
    the default connection timeout is picked.
  3. We use the proper method parameter timeout when falling back to the
    raw transport API instead of setting the ineffective parameter
    request_timeout.

With this commit we address several issues in request timeout handling:

1. We ensure that the end of the request is properly measured
2. We set an explicit request timeout on the connection to avoid that
the default connection timeout is picked.
3. We use the proper method parameter `timeout` when falling back to the
raw transport API instead of setting the ineffective parameter
`request_timeout`.
@danielmitterdorfer danielmitterdorfer added bug Something's wrong :Load Driver Changes that affect the core of the load driver such as scheduling, the measurement approach etc. labels Apr 1, 2020
@danielmitterdorfer danielmitterdorfer added this to the 1.5.0 milestone Apr 1, 2020
@danielmitterdorfer danielmitterdorfer self-assigned this Apr 1, 2020
Copy link
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 thanks for catching this

if max_num_segments:
await es.transport.perform_request("POST", "/_optimize?max_num_segments={}".format(max_num_segments),
params=params)
await es.transport.perform_request("POST", f"/_optimize?max_num_segments={max_num_segments}",
Copy link
Contributor

Choose a reason for hiding this comment

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

And so it begins (f-strings in the codebase) :)

@danielmitterdorfer danielmitterdorfer merged commit 6766745 into elastic:master Apr 1, 2020
@danielmitterdorfer danielmitterdorfer deleted the force-merge-timeout branch April 1, 2020 09:46
@danielmitterdorfer
Copy link
Member Author

Thanks for the review :)

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants