[CONPY-114] Can't add connection to pool Created: 2020-09-16  Updated: 2020-09-19  Resolved: 2020-09-19

Status: Closed
Project: MariaDB Connector/Python
Component/s: Documentation
Affects Version/s: 1.0.1
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Luciano Barcaro Assignee: Georg Richter
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

Hi Georg,

I created a pool with only 2 pre connections with

import mariadb
conn_parameter = {'host': .... }
 
pool = mariadb.ConnectionPool(pool_name='test', pool_size=2, **conn_parameter)

Checked the max_size of pool

print(pool.max_size)
# Returned 64

But, if I try to add some new connection to pool,

new_db = mariadb.connect(**conn_parameter)
pool.add_connection(new_db)

I get the exception mariadb.PoolError: Couldn't add connection to pool 'test' (no free slot available).

Am I missing something?



 Comments   
Comment by Georg Richter [ 2020-09-19 ]

It's not possible to change the size of the pool. See Documentation:

"MariaDB Connector/Python supports simple connection pooling. A connection pool holds a number of open connections and handles thread safety when providing connections to threads.
The size of a connection pool is configurable at creation time, but cannot be changed afterwards. The maximum size of a connection pool is limited to 64 connections."

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