Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Ctrl+C in pg:psql exiting #116

Closed
ryanbrainard opened this issue May 19, 2017 · 17 comments
Closed

Ctrl+C in pg:psql exiting #116

ryanbrainard opened this issue May 19, 2017 · 17 comments
Labels

Comments

@ryanbrainard
Copy link

When using pg:psql and pressing Ctrl+C (e.g. to cancel a query), the entire psql process exits instead of being trapped and cancelling the running statement.

I ran into this before and was told to reinstall the CLI. This worked last time, but this is happening again. I reinstalled the CLI again, but still no luck. I am on heroku-cli/6.6.13-57fc242 (darwin-x64) node-v7.9.0.

@msakrejda
Copy link
Contributor

@ryanbrainard does this happen on both private and standard/hobby plans?

@ryanbrainard
Copy link
Author

does this happen on both private and standard/hobby plans?

Yes.

@ransombriggs
Copy link
Contributor

@dickeyxxx ^^^ the problem that we had with psql in the ruby removal may also be an issue in v6

@msakrejda
Copy link
Contributor

Interesting, both work fine for me on Ubuntu on v5. Let me see if I can try v6.

@jdx
Copy link
Contributor

jdx commented May 22, 2017

I put sigint handling in I'm sure, but something must not be working right. I'll investigate.

@msakrejda
Copy link
Contributor

Yeah, confirmed: on v6 both kill the session for me (whereas on v5 it works fine). Let me know if you need a hand looking at this @dickeyxxx.

@jdx
Copy link
Contributor

jdx commented May 31, 2017

will be fixing this this week heroku/cli-engine#162

@jdx jdx changed the title Ctrll+C in pg:psql exiting Ctrl+C in pg:psql exiting Jun 1, 2017
@jdx jdx closed this as completed Jun 1, 2017
@ghost ghost removed the Doing label Jun 1, 2017
@jdx
Copy link
Contributor

jdx commented Jun 1, 2017

fix is out, let me know if you still see any issues

@msakrejda
Copy link
Contributor

Confirmed; this works for me as expected with v6.

@mikehale
Copy link

I'm seeing this happen again.

@mikehale mikehale reopened this Mar 29, 2018
@msakrejda
Copy link
Contributor

Works fine for me:

msakrejda@localhost:~$ heroku --version
heroku-cli/6.16.3-4239951 (linux-x64) node-v9.9.0

What version are you running @mikehale?

@mikehale
Copy link

➤  heroku --version
heroku-cli/6.16.3-4239951 (darwin-x64) node-v9.9.0

@msakrejda
Copy link
Contributor

Hmm. I tried with both private and standard plans--no issues with either here. Any ideas @jdxcode? Maybe it's only an issue on Macs?

@mikehale
Copy link

Ok I think I figured out some steps to reproduce this. It only works on under sudo for cancelling long running queries.

@mikehale
Copy link

$  heroku create -n
Creating app... done, ⬢ afternoon-woodland-96428
https://afternoon-woodland-96428.herokuapp.com/ | https://git.heroku.com/afternoon-woodland-96428.git
$  heroku addons:create heroku-postgresql -a afternoon-woodland-96428
Creating heroku-postgresql on ⬢ afternoon-woodland-96428... free
Database has been created and is available
 ! This database is empty. If upgrading, you can transfer
 ! data from another database with pg:copy
Created postgresql-defined-75441 as DATABASE_URL
Use heroku addons:docs heroku-postgresql to view documentation
$  heroku sudo pg:psql -a afternoon-woodland-96428
--> Connecting to postgresql-defined-75441
Expanded display is used automatically.
psql (10.3)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

afternoon-woodland-96428::DATABASE=> SELECT pg_sleep(60);
^C%                                                                                                                                                                                                         $  Cancel request sent                                                                                                                                                                                1 ↵
ERROR:  canceling statement due to user request
afternoon-woodland-96428::DATABASE=> \q
select 1
select>
$

@msakrejda
Copy link
Contributor

Ok, I can repro with sudo, but this seems like a sudo plugin bug, no?

@msakrejda
Copy link
Contributor

I did some further testing and pretty sure it's sudo breaking Ctrl-C. Maybe try filing an issue there? Happy to revisit if pg:psql is doing something funky that's causing problems.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants