[CONPY-177] It looks like returning a connection to ConnectionPool does not work properly. Created: 2021-11-23  Updated: 2021-12-04

Status: Open
Project: MariaDB Connector/Python
Component/s: Connection Pooling
Affects Version/s: 1.0.8
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Mariusz Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File code.py     File conpy_177.py     PNG File image-2021-11-23-17-42-29-991.png     PNG File image-2021-11-23-17-46-21-717.png     PNG File image-2021-11-23-17-47-27-075.png    
Python Version: Python 3.6.8

 Description   

Hey,

Like in subject - returning a connection to ConnectionPool does not work properly.
I see an error:

Traceback (most recent call last):
File "/home/db/connector.py", line 33, in <module>
main()
File "/home/db/connector.py", line 28, in main
x = pool.get_connection()
mariadb.PoolError: No more connections from pool 'testme' available*

Here is full code:

code.py

MariaDB Galera Cluster info:

'innodb_version', '5.6.39-83.1'
'protocol_version', '10'
'slave_type_conversions', ''
'version', '10.1.36-MariaDB'
'version_comment', 'MariaDB Server'
'version_compile_machine', 'x86_64'
'version_compile_os', 'Linux'
'version_malloc_library', 'system jemalloc'
'version_ssl_library', 'OpenSSL 1.0.1e-fips 11 Feb 2013'
'wsrep_patch_version', 'wsrep_25.23'*

Can you advise?

Thanks,
Mariusz



 Comments   
Comment by Georg Richter [ 2021-11-23 ]

Jira.mariadb.org is a bug ticket system for MariaDB software and not a photo gallery.
Please attach code and other information as text file (use copy and paste).

Comment by Mariusz [ 2021-11-24 ]

Hello Georg Richter,

You can find all info as a text.

Thank you,
Mariusz

Comment by Georg Richter [ 2021-11-25 ]

Are you sure that your code really works? port = "" should produce an error, since it has to be an integer value.
After fixing that (port=0), I wasn't able to repeat the problem (tested with Python3.7 and Python3.10 and MariaDB Connector/Python 1.0.8 and 1.1.0b2)
Could you please try to repeat the problem with a more actual Python version (3.6 will reach end of life in 4 weeks).

Comment by Mariusz [ 2021-11-25 ]

Hey!

I replaced the configuration part, because I have it done locally on internal libraries - my error here with the port. However, locally I have it done correctly - as an integer.

Funny thing - I installed a completely clean version of python 3.9 today. I also installed mariadb version 1.0.8 with pip.
The same error:

x= pool.get_connection()
mariadb.PoolError: No more connections from pool 'testme' available

To be honest - it is really strange

Do you have any ideas what might be wrong?

Thanks,
Mariusz

Comment by Georg Richter [ 2021-12-04 ]

I'm not able to repeat the problem. Running the attached conpy_177.py script:

{{Testing with
MariaDB Connector/Python version 1.0.8
Python version 3.9.6 (default, Jul 24 2021, 07:06:51)
[GCC 10.2.0]
Pool 'testme' has 5 connections
<mariadb.connection object at 0x7f2b7a34db40>
<mariadb.connection object at 0x7f2b7a25f5c0>
<mariadb.connection object at 0x7f2b7a25f720>
<mariadb.connection object at 0x7f2b7a25f880>
<mariadb.connection object at 0x7f2b7a25f9e0>
No connection available (as expected)
returning connections to pool
<mariadb.connection object at 0x7f2b7a34db40>
<mariadb.connection object at 0x7f2b7a25f5c0>
<mariadb.connection object at 0x7f2b7a25f720>
<mariadb.connection object at 0x7f2b7a25f880>
<mariadb.connection object at 0x7f2b7a25f9e0>
all connections returned to pool
schema: test}}

Generated at Thu Feb 08 03:30:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.