-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cli/sql: avoid session reconnect upon query cancellation #76483
Comments
@rafiss I did some research into using pgx instead of lib/pq. The APIs are certainly nicer and cleaner. Unfortunately, pgx does not yet support GSSAPI authentication, which some of our customers have become dependent on. So we have several possible choices forward:
WDYT? |
I think it would be great if pgx had kerberos support; that's my first choice. tracking issue for it: jackc/pgx#1166 |
Thanks sounds good. Are we providing incentives for that to happen? |
We're discussing that with the DX team. |
I think we should do something about this before we ship 22.1, the current Ctrl-C behavior is not a good look:
|
IMHO it's objectively better than the previous look, where the SQL shell would simply exit. What do you think? |
For sure, but this makes it look like something is broken or wrong. Maybe we at least can make the error message a bit more friendly or explanatory? |
What would be a good example output? |
Dropping the two warning messages would go a long way, I think. |
NB: in #79629, @otan is modifying lib/pq to support the copy protocol in a way the sql shell uses it. However, in this issue @rafiss is recommending we switch over from lib/pq to pgx to benefit from better support for query cancellation (pending support for k5s authn in pgx). How can we reconcile the two efforts? If we go towards pgx, then @otan's efforts in lib/pq will not help; how can we ensure |
i'd like COPY to be (if desirable) merged into 22.1, so at least we make progress there. we'd want to expose |
As discussed in issue cockroachdb#76483, there's a bug in lib/pq which causes the session to be aborted on query cancellation. The resulting UX is just too poor; if the session terminates, there's no real benefit in keeping the shell alive. The user may as well stop the shell and then restart it, which makes the situation clearer. This commit thus disables cancellation support in the client temporarily until we fix cockroachdb#76483. Release note (cli change): The mechanism for query cancellation is disabled in the `sql` shell until a later patch release.
As discussed in issue cockroachdb#76483, there's a bug in lib/pq which causes the session to be aborted on query cancellation. The resulting UX is just too poor; if the session terminates, there's no real benefit in keeping the shell alive. The user may as well stop the shell and then restart it, which makes the situation clearer. This commit thus disables cancellation support in the client temporarily until we fix cockroachdb#76483. Release note (cli change): The mechanism for query cancellation is disabled in the `sql` shell until a later patch release.
no objection. My question above is to determine what we'll do post-release.
that's indeed what i had in mind too, I just hope we can bring that point across with the pgx maintainers. |
I've tried doing that, but the resulting UX is still not good; a session reconnect without warning is confusing, because the user loses their customization. I think it'll be just better to remove the cancellation altogether until we fix the pq bug (or move to pgx). Doing this in #79739. |
Describe the problem
This is a followup to #76437, especially the problem noticed during testing: a bug in lib/pq forces the connection to be dropped.
Discussed with @rafiss we have two solutions
To Reproduce
run a long query and interrupt it interactively.
Expected behavior
The session remains open, including all its session variable customizations.
Jira issue: CRDB-13144
The text was updated successfully, but these errors were encountered: