-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Using hostaddr will cache the DNS lookup #2740
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
base: master
Are you sure you want to change the base?
Conversation
4f4c27a
to
2a82c1c
Compare
The reason it’s done in JavaScript is that it’s blocking in libpq, IIRC. |
It is blocking at within libpq (uses https://github.com/brianc/node-libpq/blob/master/index.js#L34 FWIW we are experiencing a stale |
Yah looking at this....I think the dns lookup in JS was done before I rewrote libpq bindings and made a proper background async connection worker thread. So this isn't needed now that we're running libpq's connect in node's threadpool. Hey sorry for the headache here but CI was broken. I fixed it yesterday...would you be able to rebase onto master? Then the tests should pass and we can merge this up and get a release out! Thank you so much for contributing! ❤️ |
2a82c1c
to
aa8774a
Compare
Rebased! Thanks so much for all your hard work, I totally <3 this library :) |
@brianc - is the CI still broken, doesn't look like a test failure. |
I'll try rerunning it - very weird error there I didn't on my branches or on master |
It looks like the errors in CI might be related to this PR...the other PR's I've rebased have all passed CI okay. 😢 |
"If host is specified without hostaddr, a host name lookup occurs." https://www.postgresql.org/docs/8.1/libpq.html#LIBPQ-CONNECT
aa8774a
to
51bf508
Compare
@brianc - I rebased, can you try rerunning? |
Also, can you point me towards the settings for running unit tests against the local pg instance |
This fixes occurrences where the IP changes for a native connection, e.g. with read replicas.
"If host is specified without hostaddr, a host name lookup occurs."
https://www.postgresql.org/docs/8.1/libpq.html#LIBPQ-CONNECT
You do not need to do the DNS lookup in javascript.
Fixes: #1748