Skip to content

Conversation

rolandwalker
Copy link
Contributor

@rolandwalker rolandwalker commented Jun 7, 2025

Description

mycli is already much better at cancelling queries on KeyboardInterrupt, compared to the vendor client. But not perfect -- and sometimes the result is an unfortunate runaway query.

Here we:

  • catch the case that "ok" is not in the status string, and emit a warning in red. Previously we only caught Exceptions.
  • add an echo to the debugged path in which cancellation is skipped.
  • downgrade the routine cancellation message to blue and add the query id number.

The first and second changes are intended to help the user notice the cases in which we fail to interrupt, and know that we failed. The third change is intended to help in unknown cases, in which we believe that we succeeded, but didn't actually interrupt.

example_query_cancel

Checklist

  • I've added this contribution to the changelog.md.
  • I've added my name to the AUTHORS file (or it's already there).

@rolandwalker rolandwalker requested a review from amjith June 7, 2025 12:35
@rolandwalker rolandwalker self-assigned this Jun 7, 2025
mycli is already _much_ better at cancelling queries on
KeyboardInterrupt, compared to the vendor client.  But not perfect --
and sometimes the result is an unfortunate runaway query.

Here we:
 * catch the case that "ok" is not in the status string, and emit a
   warning in red.  Previously we only caught Exceptions.
 * add an echo to the debugged path in which cancellation is skipped.
 * downgrade the routine cancellation message to blue and add the query
   id number.

The first and second changes are intended to help the user notice the
cases in which we fail to interrupt, and know that we failed.  The
third change is intended to help in unknown cases, in which we believe
that we succeeded, but didn't interrupt.
@rolandwalker rolandwalker force-pushed the RW/more-informative-query-cancel-keyboard-interrupt branch from a84c728 to aa46615 Compare June 7, 2025 12:39
@rolandwalker rolandwalker merged commit 10ba4bc into main Jul 4, 2025
6 checks passed
@rolandwalker rolandwalker deleted the RW/more-informative-query-cancel-keyboard-interrupt branch July 4, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant