-
Notifications
You must be signed in to change notification settings - Fork 141
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 timeout option to SQL CLI tool. #1076
Conversation
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Add timeout option to SQL CLI tool.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 2.x #1076 +/- ##
============================================
- Coverage 98.22% 95.71% -2.52%
- Complexity 3272 3351 +79
============================================
Files 314 337 +23
Lines 8205 9115 +910
Branches 535 672 +137
============================================
+ Hits 8059 8724 +665
- Misses 142 334 +192
- Partials 4 57 +53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
"response_timeout", | ||
type=click.INT, | ||
default=10, | ||
help="Timeout to await a response from the server" |
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.
should the help message indicate it's in seconds? and is the default 10 seconds too short? I think frontend request times out 30 seconds by default
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.
10 sec is default timeout in PY client.
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.
Help message updated in dad0f8f.
Signed-off-by: Yury-Fridlyand <[email protected]>
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.
LGTM
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.
Thanks.
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.x
# Create a new branch
git switch --create backport/backport-1076-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 cfb26508acc3b200f77f9059955bcdf92815b9ec
# Push it to GitHub
git push --set-upstream origin backport/backport-1076-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.x Then, create a pull request where the |
Signed-off-by: Yury-Fridlyand [email protected]
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.
See team review discussion in Bit-Quill#153.
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.