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

add Warning Full Connection Pool (event) #802

Closed
wants to merge 3 commits into from
Closed

add Warning Full Connection Pool (event) #802

wants to merge 3 commits into from

Conversation

shlee322
Copy link

Sometimes 'pool' is used without calling 'release', which is hard to detect.
By adding 'warningFullConnectionPool', developer can find unreleased pool with ease.

pool  = mysql.createPool({
  ....
  warningFullConnectionPool : true
});
pool.on('warningFullConnectionPool', function(e) {
  console.warn(e);
});

@shlee322 shlee322 closed this Apr 27, 2014
@shlee322 shlee322 reopened this Apr 27, 2014
this._pool = pool;
this._data = [];

for(var i in pool._allConnections) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break if someone does Array.prototype.thingie = function(){}. Please loop over indicies, not properties.

@shlee322
Copy link
Author

@dougwilson can't understand what you say. you mean to change type like for(i=0;;) ?

@dougwilson
Copy link
Member

You need to use for (var i = 0; i < pool._allConnections.length; i++) {

@shlee322
Copy link
Author

ok. thank you.

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

Successfully merging this pull request may close these issues.

2 participants