-
Notifications
You must be signed in to change notification settings - Fork 259
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
Pool objects are not going back to available pool. #225
Comments
Have you attached any event listeners for the factory errors, and if so, have they logged anything? pool.on('factoryCreateError', function(err){
//log stuff maybe
})
pool.on('factoryDestroyError', function(err){
//log stuff maybe
}) Also - could you paste/show your factory object, and your mysql connection settings (or whatever the defaults are). I'll try to take a look at this in more detail later, but I suspect this probably fixable by tuning the connection settings (I'll try to find a GitHub issue I saw where some had a similar problem to you). Unfortunately the current stats the pool shows you aren't very detailed don't include many of the internal queues, which would probably help pinpoint where something might be going wrong. pool. _factoryCreateOperations.size
pool._factoryDestroyOperations.size
pool._validationOperations.size |
Thank you so much @sandfox. I have added the logs and error listers as you suggested.
There are times when _factoryCreateOperations gets stuck to a non zero number and service show no error at all. (like above scenario) and then the pool object never gets created and my available count is always (min - number of _factoryCreateOperations stuck).
In above case, there are times when my available falls to 0, _factoryCreateOperations is 5 (which 5 connections never gets created.) and I have no option other then crashing/restarting my node service. It also happens 1 in 10 cases that my azure database gives connection timeout but after a millisecond I am able to connect to the database successfully. Is there any way by which we can retry |
Guys, Any updates in this? My production is heading to a big event today and I am in a big mess because of this issue. |
Hey @JankiGadhiya sorry, I've been a bit busy and probably won't have time to properly look at this till the weekend. I am guessing here, but it could be worth using As long as your I'll have a look at adding timeouts to pool to protect against this. edit: I only just saw you've edited your previous messages with more info! thanks |
@sandfox, Can you please do these changes to the generic-pool code and release a new version? |
@sandfox Hi, I am not able set retry logic for factory create calls. Can you please help me with this? |
@JankiGadhiya I ran into a similar problem with MS SQL, perhaps this will help you - tediousjs/node-mssql#610 (comment) |
Hi All,
We are in a serious mess because of this issues. My website is in production and every single day we are facing this issues since last 2 week.
My pool connection configurations are:
at the start of the service my pool statistics are:
Available : 30
Size : 30
Pending : 0
Borrowed : 0
After execution of some 500 requests, The pool statistics are doubtable.
Available : 0
Size : 30
Pending : 0
Borrowed : 0
i.e. the pool should contain minimum available connections after the execution but it is not happening in my case.
For this pool statistics I am getting
Resource Request timeout
. There are cases when it is working fine.Available : 1
Size : 30
Pending : 0
Borrowed : 0 (Working)
Available : 30
Size : 30
Pending : 0
Borrowed : 0 (Working)
Available : 0
Size : 30
Pending : 0
Borrowed : 0 (Not Working)
The mssql module is not able to create available minimum connection after some time. Can anyone suggest any connection configuration or is this any bug?
PS : My MSSQL is azure managed service.
The text was updated successfully, but these errors were encountered: