-
Notifications
You must be signed in to change notification settings - Fork 313
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
Add support for custom headers and request-timeout #1070
Conversation
💚 CLA has been signed |
esrally/driver/runner.py
Outdated
timeout=request_timeout) | ||
else: | ||
await es.transport.perform_request("POST", "/_optimize", timeout=request_timeout) | ||
await es.transport.perform_request(method="POST", url="/_optimize", params=merge_params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transport.perform_request()
expects the timeout
parameter in the params
arg. Throws
TypeError: perform_request() got an unexpected keyword argument 'timeout'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like you removed the logic here about max_num_segments
. Good catch about the timeout though, lets definitely fix that here once you revert the code change that deleted the if
stmt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max_num_segments exists in the merge_params and gets applied to the query string by the perform_request method
Hi, @DJRickyB , thank you very much for your contribution! This is good work so far. I have one overall suggestion that might make the code cleaner. It also requires a bit of context. We hope to one day utilize more than just the timeout in the future, for instance, the opaque-id, so it might make sense to consolidate all of the different I have also added just a few minor nits to the pull request that I saw right off the bat, before realizing we could extract the common functionality into the Runners. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! I meant to post that comment into this review, not as just a comment. here are the nits I mentioned in the review itself!
esrally/driver/runner.py
Outdated
timeout=request_timeout) | ||
else: | ||
await es.transport.perform_request("POST", "/_optimize", timeout=request_timeout) | ||
await es.transport.perform_request(method="POST", url="/_optimize", params=merge_params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like you removed the logic here about max_num_segments
. Good catch about the timeout though, lets definitely fix that here once you revert the code change that deleted the if
stmt
Thank you Michael! Your timing is perfect, I was planning on finishing this PR this weekend. Please pardon the force-push, it's not usually my style but I wanted a way to get prior git history to apply to the comment lines I had touched |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow this looks great now! I love how its not touching all the tests. Also, Thank you SO VERY much for making the PR name more descriptive. Just some minor nits now and this will be good to go.
One other thing, go ahead and merge master in git merge upstream/master
and run make precommit
, and it will show you one line length failure you have. This will fail before the tests will run. Once you are done w this ill make sure our CI infra can run the tests.
tests/driver/runner_test.py
Outdated
"status": "green", | ||
"relocating_shards": 0 | ||
}) | ||
r = runner.ClusterHealth() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we try not to have single value names for variables, lets make this a bit more descriptive
@elasticmachine ok to test |
grr, my magic incantation is incorrect. @elasticmachine add to allowlist please |
ok at this point w/ the proper incantation, your PR will now run tests for each commit. If it fails for some reason, go ahead and fix it up (or ask for help if need be), and push, and it should run the tests again. |
is there somewhere i can push new test tracks to exercise the functionality? good to see it looks like no regressions :) |
If you push some test tracks, it would be rad to just push them to a branch, and then link the commands you use (assuming the repos were checked out locally). Ill test them myself to double check and then we can call this done and merge it. Im off tomorrow, but I should be able to get to them by monday if you push some branches up to your fork of rally tracks. |
Also, I forgot to add, if you are using and existing corpora, you can use the built in rally |
Thanks, sorry for the delay. Running with local test tracks and watching with wireshark revealed a couple of misses in params.py based on how parameter parsing for a given operation was set up. The changes I made add 3 Edit: going to change the counts tests and update parameters. submitted originally for feedback but the right path became obvious after another cup of coffee FYI I'm just using this locally: elastic/rally-tracks@d7b1ac4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay, its merge time!
Currently in polling mode, the force merge operation uses a very short timeout (1s) which, in case of slow response times, might actually cause the operation to not get executed. Since elastic#1070 we can specify per operation request-timeout and we should honor that one instead.
…#1122) Currently in polling mode, the force merge operation uses a very short timeout (1s) which, in case of slow response times, might actually cause the operation to not get executed. Since #1070 we can specify per operation request-timeout and we should honor that one instead. Co-authored-by: Daniel Mitterdorfer <[email protected]>
Addresses #567 and #1000
Well it became trivial to add
headers
andopaque-id
support for everything in the course of this refactor so I added that too.Done: