Skip to content
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

undefined socket if stop postgresql.service at beginning. #136

Closed
szdailei opened this issue Dec 30, 2020 · 0 comments
Closed

undefined socket if stop postgresql.service at beginning. #136

szdailei opened this issue Dec 30, 2020 · 0 comments

Comments

@szdailei
Copy link

Bug Report

lib/connection.js:

function onclose() {
  socket.removeListener('data', data)
  socket.removeListener('error', error)
  socket.removeListener('connect', ready)
  socket.removeListener('secureConnect', ready)
  closed = true
  close()
}

If I stop postgresql.service and then start program, socket will be undefined.

socket.removeListener('data', data);
^
TypeError: Cannot read property 'removeListener' of undefined
at Socket.onclose (file:///home/dailei/projects/www/packages/api-server/dist/index.js:1172:12)
at Object.onceWrapper (events.js:422:26)
at Socket.emit (events.js:315:20)
at TCP. (net.js:673:12)

I guess nodejs net.connect removes socket.

envinfo

Arch Linux 5.9.13-arch1-1
Nodejs 14.15.3
PostgreSQL 13
postgres 1.0.2 and 2.0.0-beta.2

Suggested change

Pull Request: Fix undefined socket if stop postgresql.service at beginning

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

No branches or pull requests

1 participant