[CONPY-216] Process hang while invoke ConnectionPool.get_connection() Created: 2022-07-18 Updated: 2022-07-19 |
|
| Status: | Open |
| Project: | MariaDB Connector/Python |
| Component/s: | Connection Pooling |
| Affects Version/s: | 1.0.11 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | long jin | Assignee: | Georg Richter |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
debian 10 |
||
| Attachments: |
|
| Python Version: | 3.8 |
| Description |
|
Hi, may be I found a bug in ConnectionPool.get_connection(). You can reproduce the problem through the following steps:
Then the program will fall into a dead cycle which "ping-failed-continue-ping". I think, this is a bug |
| Comments |
| Comment by Georg Richter [ 2022-07-18 ] |
|
Hi, get_connection method loops over connections which aren't in use, tries to ping and returns. If all connections became invalid, it needs to loop over all connections. Why do you think it is a bug? |
| Comment by long jin [ 2022-07-18 ] |
|
Hmm, but in the case above, if all connections are invalid, the function may not return, even a `None`. |
| Comment by long jin [ 2022-07-19 ] |
|
May be we can try to reconnect the connection in the get_connection() function when the conn is broken. |