Bug #104374 | Pooling connection closed | ||
---|---|---|---|
Submitted: | 21 Jul 2021 8:06 | Modified: | 6 Oct 2021 21:43 |
Reporter: | ALEKSANDAR MAKEDONSKI | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector for Node.js | Severity: | S3 (Non-critical) |
Version: | 8.0.26 | OS: | Linux (Ubuntu 20.04) |
Assigned to: | Rui Quelhas | CPU Architecture: | Any |
[21 Jul 2021 8:06]
ALEKSANDAR MAKEDONSKI
[22 Jul 2021 13:39]
ALEKSANDAR MAKEDONSKI
Problem is here ( ~/xdevapi/lib/DevAPI/Connection.js ) : in example (now - state.endpoints.unavailable[0].unavailableAt ) is always around 0 and state.retryAfter is 20000 update () { const now = Date.now(); // Check which unavailable endpoints can be re-tried. // If the current element in the list is not "retryable", neither // are the remaining. A retryable endpoint is any endpoint that has // been unavailable since at least the time interval defined by // state.retryAfter. while (state.endpoints.unavailable.length && now - state.endpoints.unavailable[0].unavailableAt > state.retryAfter) { // If an endpoint can be re-tried we need to move it back to // the list of available endpoints. state.endpoints.available.push(state.endpoints.unavailable.shift()); } return this; }
[30 Jul 2021 14:17]
Rui Quelhas
Hi Aleksandar, thanks for the report. It seems the connection pool implementation has some parallelism issues indeed. However, they are in any way related to that piece of code, because that only applies to multi-host connections, which I guess is not the case. Also, the problem is not with the queries themselves, but with the underlying connections (which are acquired from the pool). What happens is that you are hitting the maximum number of X Protocol connections in the server (mysqlx_max_connections), and because of the parallelism issues, the pool is not properly queuing the request to acquire further connections, when they become available. In any case, this is a bug, and will eventually be addressed. However, I do not consider it an S2, so I'm updating the severity.
[6 Oct 2021 21:43]
Philip Olson
Posted by developer: Fixed as of the upcoming MySQL Connector/Node 8.0.27 release, and here's the proposed changelog entry from the documentation team: Improved the connection pool mechanism, namely parallelism issues that stemmed from exceeding mysqlx_max_connections as the pool was not properly queuing the request to acquire further connections when they become available. Thank you for the bug report.