Update opts.py to allow for 'None' timeout-value in client_options #1541
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.
Rally sets a default timeout (60s) for every http api call to elasticsearch.
For long running queries this timeout introduces some problems, because rally will fail with a client timeout (which is only traceable via the logs). To work around this timeout issues, one must set the timeout to an arbitrary high value to account for any possible timeouts.
Rally actually supports the following three options for values set in the
--client-options
parameter:int
,float
orboolean
. For the timeout value an additionalNone
is required to allow not specifing a timeout at all.This is due to the underlying
urllib3
which requires either anint
,float
orNone
value as a timeout as shown by the following error message:.../urllib3/util/timeout.py": ValueError: Timeout value connect was None, but it must be an int, float or None.
So far only
int
andfloat
are usable from the commandline becauseNone
cannot be passed via the--client-options
parameter.This pull request fixes this issue by added the needed functionality to the
opts.py
module. Ato_none()
function is added which parses the String"None"
to the pythonicNone
and is called in thekv_to_map()
function which parses the--client-options
parameters.Edit: signed contributor agreement