-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
native connect failures seem to leak resources #417
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
Comments
That's troubling. I'll look into this one. On Wed, Aug 14, 2013 at 9:03 PM, Joe Faber [email protected] wrote:
|
Native bindings have been completely rewritten from scratch! Can you try now with npm install [email protected] Pretty sure this problem has gone away. :) |
node-pg: 2.3.1
macos: 10.8.4
node: 0.8.22
Repeated calls to pg.connect when the pg server is not running will eventually start to return a different error suggesting that there's a resource leak. The following snippet reproduces the issue:
In this configuration, the last several calls produce either "[Error: could not create socket: Too many open files" or "{ [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' }". Changing the comment to call attemptToConnect after a short delay seems to avoid the "Too many open files" error, but still shows the other one for the last several calls. Obviously, you might need to modify nAttempts to repro this.
Note that the non-native version does not seem to have this problem. It does produce a different error, but it seems to do so consistently regardless of how many times pg.connect is called.
The text was updated successfully, but these errors were encountered: