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

Error can be a string, and shards not always present in response. #613

Merged
merged 2 commits into from
Dec 6, 2018
Merged

Error can be a string, and shards not always present in response. #613

merged 2 commits into from
Dec 6, 2018

Conversation

j-bennet
Copy link
Contributor

@j-bennet j-bennet commented Dec 1, 2018

When there are bulk indexing errors, rally throws an exception Cannot race. Error in load generator, instead of finishing successfully and reporting indexing errors as part of error_rate. This fixes the problem.

Traceback from rally log:

2018-12-01 02:34:42,357 ActorAddr-(T|:57054)/PID:36237 esrally.driver.driver ERROR Could not execute schedule
Traceback (most recent call last):

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/driver.py", line 996, in __call__
    total_ops, total_ops_unit, request_meta_data = execute_single(runner, self.es, params, self.abort_on_error)

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/driver.py", line 1028, in execute_single
    return_value = runner(es, params)

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/runner.py", line 117, in __call__
    return self.runnable(es['default'], *args[1:])

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/runner.py", line 363, in __call__
    stats = self.detailed_stats(params, bulk_size, response) if detailed_results else self.simple_stats(bulk_size, response)

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/runner.py", line 439, in simple_stats
    self.extract_error_details(error_details, data)

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/runner.py", line 452, in extract_error_details
    if data.get("error") and data["error"].get("reason"):

AttributeError: 'str' object has no attribute 'get'

2018-12-01 02:34:42,636 ActorAddr-(T|:57050)/PID:36235 esrally.driver.driver ERROR Cannot execute runner [user-defined context-manager enabled runner for [bulk-index]]; most likely due to missing parameters.
Traceback (most recent call last):

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/driver.py", line 1028, in execute_single
    return_value = runner(es, params)

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/runner.py", line 117, in __call__
    return self.runnable(es['default'], *args[1:])

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/runner.py", line 363, in __call__
    stats = self.detailed_stats(params, bulk_size, response) if detailed_results else self.simple_stats(bulk_size, response)

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/runner.py", line 437, in simple_stats
    if data["status"] > 299 or data["_shards"]["failed"] > 0:

KeyError: '_shards'

2018-12-01 02:34:42,637 ActorAddr-(T|:57050)/PID:36235 esrally.driver.driver ERROR Could not execute schedule
Traceback (most recent call last):

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/driver.py", line 1028, in execute_single
    return_value = runner(es, params)

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/runner.py", line 117, in __call__
    return self.runnable(es['default'], *args[1:])

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/runner.py", line 363, in __call__
    stats = self.detailed_stats(params, bulk_size, response) if detailed_results else self.simple_stats(bulk_size, response)

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/runner.py", line 437, in simple_stats
    if data["status"] > 299 or data["_shards"]["failed"] > 0:

KeyError: '_shards'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/driver.py", line 996, in __call__
    total_ops, total_ops_unit, request_meta_data = execute_single(runner, self.es, params, self.abort_on_error)

  File "/Users/irina/.pyenv/versions/3.6.5/envs/benchmarks/lib/python3.6/site-packages/esrally/driver/driver.py", line 1059, in execute_single
    raise exceptions.SystemSetupError(msg)

esrally.exceptions.SystemSetupError: ("Cannot execute [user-defined context-manager enabled runner for [bulk-index]]. Provided parameters are: ['name', 'operation-type', 'corpora', 'bulk-size', 'indices', 'include-in-reporting', 'index', 'type', 'action-metadata-present', 'body', 'bulk-id']. Error: ['_shards'].", None)

@dliappis dliappis self-requested a review December 5, 2018 14:13
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.

Thank you for this PR!

Seeing that this is something we are already doing in the detailed stats (

if data["status"] > 299 or ("_shards" in data and data["_shards"]["failed"] > 0):
), this makes sense.

I left one request to add a test.

esrally/driver/runner.py Show resolved Hide resolved
@dliappis dliappis added bug Something's wrong :Metrics How metrics are stored, calculated or aggregated labels Dec 5, 2018
@dliappis dliappis added this to the 1.0.3 milestone Dec 5, 2018
@j-bennet
Copy link
Contributor Author

j-bennet commented Dec 5, 2018

Test added.

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 thank you very much for this.

@dliappis dliappis merged commit 738959a into elastic:master Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's wrong :Metrics How metrics are stored, calculated or aggregated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants