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

cqlsh could adjust client request timeout for USING TIMEOUT queries #244

Open
avelanarius opened this issue Apr 14, 2021 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@avelanarius
Copy link

This is a small suggestion for a user experience improvement. In Scylla 4.4.0, USING TIMEOUT syntax was introduced. However, if you want to execute query with per-query timeout in cqlsh, you must remember to change --request-timeout option:

$ cqlsh 127.0.0.2
cqlsh> SELECT COUNT(*) FROM ks.zrodlo USING TIMEOUT 20m;
OperationTimedOut: errors={'127.0.0.2': 'Client request timeout. See Session.execute[_async](timeout)'}, last_host=127.0.0.2

$ cqlsh 127.0.0.2 --request-timeout 1200
cqlsh> SELECT COUNT(*) FROM ks.zrodlo USING TIMEOUT 20m;

 count
---------
 9995165

(1 rows)

For better user experience, cqlsh could:

  1. Give a better error message. Currently it prints:
OperationTimedOut: errors={'127.0.0.2': 'Client request timeout. See Session.execute[_async](timeout)'}, last_host=127.0.0.2

and there is no suggestion to use --request-timeout flag.

  1. Automatically change client request timeout (or maybe ask the user if they want to change it). I am aware that to do this it could require parsing the query on the cqlsh side (so possibly not worth it).

/cc @psarna (only a suggestion, not that this is important)

@psarna
Copy link
Contributor

psarna commented Sep 16, 2022

@avelanarius cqlsh already parses statements: https://github.com/apache/cassandra/blob/56ea39ec704a94b5d23cbe530548745ab2420cee/bin/cqlsh.py#L970 , and even though USING TIMEOUT is ScyllaDB-specific, USING isn't on its own (https://github.com/apache/cassandra/blob/f28dd90feb215db85ac2e510c5657a49edd46e12/pylib/cqlshlib/cqlhandling.py#L32), so there's a fair chance such validation can be done rather easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants