I used MySQL npm package in my one of NodeJS projects.

When I was testing my program, I realized that after a while “pool.getConnection(function(err, connection)” blocks were not be fired.

There was neither any error nor any output.

After reading documentations, I found the problem.

I forgot to release connections on some lines.

The total number of available connection pools is 10 by default, so if you forgot to release your connections, after calling “pool.getConnection” function 10 times, it will never be fired again and connections will be queued.

You can catch queued connections by;

pool.on('enqueue', function () {
    console.log('Waiting for available connection slot');