Description:
Setting the connection pooling when MySQL Fabric is in use seems to be broken.
The problem does not happen in previous releases that support MySQL Fabric.
The following error is reported:
...
return self.__cnx.cursor()
File "/usr/local/lib/python2.7/dist-packages/mysql/connector/fabric/connection.py", line 1168, in cursor
self._connect()
File "/usr/local/lib/python2.7/dist-packages/mysql/connector/fabric/connection.py", line 1128, in _connect
self._mysql_cnx = MySQLConnection(**dbconfig)
File "/usr/local/lib/python2.7/dist-packages/mysql/connector/connection.py", line 129, in __init__
self.connect(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/mysql/connector/connection.py", line 504, in connect
self.config(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/mysql/connector/connection.py", line 410, in config
raise AttributeError("Unsupported argument '{0}'".format(key))
AttributeError: Unsupported argument 'pool_name'
This happens because of the following code:
def config(self, **kwargs):
...
for key, value in config.items():
try:
DEFAULT_CONFIGURATION[key]
except KeyError:
raise AttributeError("Unsupported argument '{0}'".format(key)
Neither pool_name or pool_size are present in the DEFAULT_CONFIGURATION dictionary. However, even after ignoring the KeyError, the connection pooling
does not seem to be working properly.
How to repeat:
params = {
"fabric" : {
"host" : fabric_host, "port" : fabric_port, "user" : "admin",
"password" : "password"
},
"user" : user, "passwd" : passwd, "database" : "mysql", "pool_name" :
"pool_name"
}
cnx = connect(**params)
cur = cnx.cursor()