[CONPY-255] ConnectionPool.get_connection does not raise mariadb.PoolError Created: 2023-03-28 Updated: 2023-04-11 Resolved: 2023-04-11 |
|
| Status: | Closed |
| Project: | MariaDB Connector/Python |
| Component/s: | Connection Pooling |
| Affects Version/s: | 1.1.5, 1.1.6 |
| Fix Version/s: | 1.1.7 |
| Type: | Bug | Priority: | Minor |
| Reporter: | G.Mech | Assignee: | Georg Richter |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Win10 21H2, MariaDB Server 10.6.11 (official docker image) |
||
| Attachments: |
|
| Python Version: | 3.10.4 |
| Description |
Steps to reproduce
The example code initializes a ConnectionPool with 3 connections and calls get_connection() 4 times. Expected outcomeAs the documentation says, get_connection should raise a PoolError, because no connection is available:
Actual outcomeget_connection() does not raise PoolError but returns None WorkaroundDo not catch PoolError but test return value:
RemarksThere is probably much code which relies on the current implementation, so its probably better to change the documentation. There is a test case test_connection_pool_maxconn in .\testing\test\integration\test_pooling.py but it does not assert that a PoolError is raised. |
| Comments |
| Comment by G.Mech [ 2023-03-28 ] | |||||||||||||||
|
I can reproduce the issue by changing test_connection_pool_maxconn as follows:
| |||||||||||||||
| Comment by Georg Richter [ 2023-04-11 ] | |||||||||||||||
|
Thanks for your bug report. |