opensearch-project / opensearch-benchmark

OpenSearch Benchmark - a community driven, open source project to run performance tests for OpenSearch
https://opensearch.org/docs/latest/benchmark/
Apache License 2.0
111 stars 78 forks source link

[BUG]Refine Error Handling Strategy in execute_single Function #466

Open saimedhi opened 8 months ago

saimedhi commented 8 months ago

Describe the bug Improve the error handling in the execute_single() function by limiting it to general, top-level exceptions and implementing a dedicated error handling mechanism within individual runners. For example, using a wrapper around each runner to catch and manage exceptions specific to their operations.

To Reproduce For example, in the CreateIndex runner, when invoking opensearch.indices.create(index=index, body=body, **api_params), error handling occurs at the execute_single level, located several layers up the stack. As a result, pinpointing the exact source of errors becomes challenging for users.

Expected behavior This approach ensures that execute_single() remains clean and focused on its primary responsibility, while runners are equipped with custom error handling tailored to their specific needs. This strategy enhances code readability and error management efficiency.

gkamat commented 8 months ago

This will be the right approach so that additional client support can be eventually added.

gkamat commented 4 weeks ago

@saimedhi, since you have implemented some related changes, do you plan to work on this as well?