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

does not exit cleanly if pg:psql postgres connection dies #82

Open
msakrejda opened this issue Jan 7, 2017 · 4 comments
Open

does not exit cleanly if pg:psql postgres connection dies #82

msakrejda opened this issue Jan 7, 2017 · 4 comments

Comments

@msakrejda
Copy link
Contributor

Steps to repro:

  1. Run heroku pg:psql
  2. In a separate session, find the pid of the first session and run pg_terminate_backend (I think pg:killall would also work)
  3. Try to exit the original psql session with \q. You'll get the following error:
shogun-maciek::DATABASE=> \q
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at exports._errnoException (util.js:1007:11)
    at TCP.onread (net.js:563:26)
@jdx
Copy link
Contributor

jdx commented Jan 10, 2017

probably should still error out with ECONNRESET, but maybe not with the call stack.

@msakrejda
Copy link
Contributor Author

Yeah, it's kinda weird, since if you don't quit immediately, psql will re-establish the session for you. Also, I can't seem to replicate this anymore, so maybe there's more to this. I'll leave it open in case someone else wants to try to repro...

@msakrejda
Copy link
Contributor Author

Ok, I've looked some more into this and I can replicate it somewhat reliably, but I have no idea what's going on. The error handler we've added here doesn't trigger for this error, even though it does trigger correctly if, e.g., I change my PATH to exclude psql. I don't see where else we might be expected to install an error event handler, but the message clearly complains about a missing error handler. Could this be a node issue?

@dickeyxxx or @ransombriggs any ideas?

@msakrejda
Copy link
Contributor Author

I think this might be related to #99

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

No branches or pull requests

2 participants