Add timeout option to SQL CLI tool. #153
Merged
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.
Signed-off-by: Yury-Fridlyand yuryf@bitquilltech.com
Description
Add response timeout option to SQL CLI tool. This is very handy for SQL plugin debugging purposes.
Imagine you are debugging a query and placed a breakpoint into the plugin code. While you are going step-by-step debugging, CLI times out.
New command line optional argument added:
If not given, SQL CLI works as usual. Default timeout is 10 sec.
Before
After
Parameter
request_timeout
is processed by underlying library:https://github.com/opensearch-project/opensearch-py/blob/8879644ec404b3ab15b739b97775d7bd7e51018b/opensearchpy/transport.py#L457
How to test
Ref: https://github.com/opensearch-project/sql/blob/2.x/sql-cli/development_guide.md#development-environment-set-up
Do once:
Then every time you want to debug SQL CLI:
To exit from
venv
:You can run SQL CLI and switch branch. It will keep working with given timeout until closed.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.