tconbeer / harlequin

The SQL IDE for Your Terminal.
https://harlequin.sh
MIT License
3.68k stars 85 forks source link

Harlequin freezes in context menu #668

Open DasFaultier opened 17 hours ago

DasFaultier commented 17 hours ago

Before Proceeding, please acknowledge:

Describe the bug Harlequin uses 100% CPU resources of one CPU core and becomes unresponsive when using an item from the context menu to explore an SQLite database.

To Reproduce

  1. Create a copy of any SQLite DB to experiment with. (I've done this with Firefox's bounce-tracking-protection.sqlite and an SQLite DB that is created and used by one of our internal applications at work.)
  2. Open the BD in Harlequin using harlequin -a sqlite dbname.sqlite.
  3. Using the left pane , navidate to any table of that DB and press . to open the context menu.
  4. Pick an item from the context menu (I was interested in "Preview Data" and "Describe", the behaviour was the same.)
  5. Run the chosen item and watch Harlequin freeze and eat up 100% of a CPU core. I had to send it a SIGTERM to exit Harlequin.

Expected behavior Do not freeze. :)

Actual behavior Does freeze. :)

Contributing Are you interested in contributing a fix?

Additional context Please provide as much as you can, but don't waste your time if it's definitely not relevant or you don't know.

What is the output of harlequin --version?

harlequin, version 1.25.0
Installed Adapters:
  - duckdb, version 1.25.0
  - sqlite, version 1.25.0

What database adapter are you using with Harlequin? (Default is duckdb) SQLite only

What other options are you using when invoking Harlequin? (If you are using a profile, please add relevant items from your profile here). None.

Can you tell us more about your system? I've tried this on two separate systems to verify that this is not an issue with PuTTY or the SSH session. System 1:

System 2:

[!TIP] For example, for my system, these are:

  • Bash
  • Windows Terminal
  • Ubuntu 22.04 / WSL2
  • Windows 11
  • en_US/UTF-8

How did you install Harlequin?

tconbeer commented 9 hours ago

Thanks for the report; something seems wrong with message handling -- I wonder if this could be related to #659