Pool execute won't release connection
See original GitHub issueI have setup a pool like this:
pool = mysql.createPool({
//host, port,etc...
waitForConnections: false,
queueLimit: 1,
debug: false,
namedPlaceholders: true,
supportBigNumbers: true
});
I then try to run queries with pool.execute, which I assume should close connections automatically as query does according to docs:
pool.query(function(err, conn) {
conn.query(/* ... */);
// Connection is automatically released when query resolves
})
However, it seems that the connections are left in sleep state (visible from information_schema.processlist) and once the connection limit (default 10) is reached, my code stops and waits until the database hits it’s timeout (100 seconds) and kills the dangling connections, then again the next 10 queries run and so on…
Am I missing something? The database is MariaDB 10.2.16
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
node.js - Connection.release() does not ... - Stack Overflow
Connection.release doesnt release the connection back to the pool, which is causing the memory leak and the program gets crashed. let connection ...
Read more >Pooled Connections Not Releasing - JBoss.org
I am using JNDI lookups to get my database connections from MySQL in the following manner: InitialContext initialContext = new ...
Read more >Common Reasons Why Connections Stay Open for a Long ...
When you are monitoring connection pool performance, you may occasionally notice that connections are staying open for long periods of time.
Read more >What is connection pooling, and why should you care
Pooling connections can help, so here's what connection pooling is and ... for an available connection to open up before they can execute....
Read more >A.15 MySQL 8.0 FAQ: MySQL Enterprise Thread Pool
By contrast, the Thread Pool operates on the MySQL server side and is designed to manage the execution of inbound concurrent connections and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
looks like code in readme is incorrect, I’ll fix that
Follow this and you should be good…
Link: https://github.com/sidorares/node-mysql2/issues/840#issuecomment-415228661