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

Mysql2 Pool takes a 10-minute break after inquiring for information. The second inquiry will be reported to read ECONNRESET. #907

Open
wadezha opened this issue Jan 14, 2019 · 4 comments

Comments

@wadezha
Copy link

wadezha commented Jan 14, 2019

image

Test
image
image

results of execution

first query, Pool value:
image

Execute the second time without rest:
image

Take a 10-minute break and execute again:
image

Other:
const mysqlConfig = {
host: ‘localhost’,
user: ‘root’,
password: ‘root’,
database: ‘my_db’,
port: 3306,
};

mysql version:5.6.31
use mysql + co running the same code is OK,No database settings have been made, wait_timeout is 28800

@wadezha
Copy link
Author

wadezha commented Jan 23, 2019

@sidorares Can you help solve this problem?

@anthonywebb
Copy link

I am having the same issue with mysql 8.0.13 @wadecha

@wadezha
Copy link
Author

wadezha commented Feb 15, 2019

@sidorares Can you help us ?

@sidorares
Copy link
Owner

It feels like for whatever reason idle connections are not removed from pool when server closes them after wait_timeout. Can you check this line is called after 10 minutes?

this._notifyError(this._protocolError);

Maybe not with pool but with one single persistent connection:

const conn = mysql.createConnection(config);
conn.on('error', err => {
   console.log('Connection error:', err'); // this line is expected to be called when server terminates connection
});
conn.query('select 1+1');

@benbotto benbotto mentioned this issue Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants