Steps to reproduce
set enviroment variables to allow login to server (see attached file)
Run python example
The example code initializes a ConnectionPool with 3 connections and calls get_connection() 4 times.
Expected outcome
As the documentation says, get_connection should raise a PoolError , because no connection is available:
ConnectionPool.get_connection()
Returns a connection from the connection pool or raises a PoolError exception if a connection is not available.
Actual outcome
get_connection() does not raise PoolError but returns None
Workaround
Do not catch PoolError but test return value:
conn = pool.get_connection()
if not conn:
# put error handling here
Remarks
There 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.
G.Mech
created issue -
2023-03-28 15:13
G.Mech
made changes -
2023-03-28 15:15
Field
Original Value
New Value
Description
h2. Steps to reproduce
# set enviroment variables to allow login to server (see attached file)
# Run python example
The example code initializes a {{ConnectionPool}} with 3 connections and calls {{get_connection()}} 4 times.
h2. Expected outcome
As the the [documentation|https://mariadb-corporation.github.io/mariadb-connector-python/pool.html#mariadb.ConnectionPool.get_connection ] says, {{get_connection}} should raise a {{PoolError}}, because no connection is available:
{quote}ConnectionPool.get_connection()
Returns a connection from the connection pool or raises a PoolError exception if a connection is not available.{quote}
h2. Actual outcome
{{get_connection()}} does not raise {{PoolError}} but returns {{None}}
h2. Workaround
Do not catch {{PoolError}} but test return value:
{code:python}
conn = pool.get_connection()
if not conn:
# put error handling here
{code}
h2. Remarks
There 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.
h2. Steps to reproduce
# set enviroment variables to allow login to server (see attached file)
# Run python example
The example code initializes a {{ConnectionPool}} with 3 connections and calls {{get_connection()}} 4 times.
h2. Expected outcome
As the [documentation|https://mariadb-corporation.github.io/mariadb-connector-python/pool.html#mariadb.ConnectionPool.get_connection ] says, {{get_connection}} should raise a {{PoolError}}, because no connection is available:
{quote}ConnectionPool.get_connection()
Returns a connection from the connection pool or raises a PoolError exception if a connection is not available.{quote}
h2. Actual outcome
{{get_connection()}} does not raise {{PoolError}} but returns {{None}}
h2. Workaround
Do not catch {{PoolError}} but test return value:
{code:python}
conn = pool.get_connection()
if not conn:
# put error handling here
{code}
h2. Remarks
There 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.
G.Mech
made changes -
2023-03-28 15:15
Description
h2. Steps to reproduce
# set enviroment variables to allow login to server (see attached file)
# Run python example
The example code initializes a {{ConnectionPool}} with 3 connections and calls {{get_connection()}} 4 times.
h2. Expected outcome
As the [documentation|https://mariadb-corporation.github.io/mariadb-connector-python/pool.html#mariadb.ConnectionPool.get_connection ] says, {{get_connection}} should raise a {{PoolError}}, because no connection is available:
{quote}ConnectionPool.get_connection()
Returns a connection from the connection pool or raises a PoolError exception if a connection is not available.{quote}
h2. Actual outcome
{{get_connection()}} does not raise {{PoolError}} but returns {{None}}
h2. Workaround
Do not catch {{PoolError}} but test return value:
{code:python}
conn = pool.get_connection()
if not conn:
# put error handling here
{code}
h2. Remarks
There 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.
h2. Steps to reproduce
# set enviroment variables to allow login to server (see attached file)
# Run python example
The example code initializes a {{ConnectionPool}} with 3 connections and calls {{get_connection()}} 4 times.
h2. Expected outcome
As the [documentation|https://mariadb-corporation.github.io/mariadb-connector-python/pool.html#mariadb.ConnectionPool.get_connection ] says, {{get_connection}} should raise a {{PoolError}}, because no connection is available:
{quote}ConnectionPool.get_connection()
Returns a connection from the connection pool or raises a PoolError exception if a connection is not available.{quote}
h2. Actual outcome
{{get_connection()}} does not raise {{PoolError}} but returns {{None}}
h2. Workaround
Do not catch {{PoolError}} but test return value:
{code:python}
conn = pool.get_connection()
if not conn:
# put error handling here
{code}
h2. Remarks
There 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.
Georg Richter
made changes -
2023-03-29 07:46
Fix Version/s
1.1.7
[ 28707
]
Georg Richter
made changes -
2023-04-11 06:56
Resolution
Fixed
[ 1
]
Status
Open
[ 1
]
Closed
[ 6
]
{"report":{"fcp":1090.8999996185303,"ttfb":421.19999980926514,"pageVisibility":"visible","entityId":120594,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"f92cfe97-2147-4dbe-8769-7397d9f97846","navigationType":0,"readyForUser":1176.5,"redirectCount":0,"resourceLoadedEnd":1067.3000001907349,"resourceLoadedStart":426.5,"resourceTiming":[{"duration":157.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":426.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":426.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":584.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":158,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":426.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":426.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":584.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":200.4000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":426.8999996185303,"connectEnd":426.8999996185303,"connectStart":426.8999996185303,"domainLookupEnd":426.8999996185303,"domainLookupStart":426.8999996185303,"fetchStart":426.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":590,"responseEnd":627.3000001907349,"responseStart":602.5999994277954,"secureConnectionStart":426.8999996185303},{"duration":209.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":427,"connectEnd":427,"connectStart":427,"domainLookupEnd":427,"domainLookupStart":427,"fetchStart":427,"redirectEnd":0,"redirectStart":0,"requestStart":590.0999994277954,"responseEnd":636.3000001907349,"responseStart":604.8999996185303,"secureConnectionStart":427},{"duration":174.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":427.30000019073486,"connectEnd":427.30000019073486,"connectStart":427.30000019073486,"domainLookupEnd":427.30000019073486,"domainLookupStart":427.30000019073486,"fetchStart":427.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":590.1999998092651,"responseEnd":602,"responseStart":601,"secureConnectionStart":427.30000019073486},{"duration":177.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":427.3999996185303,"connectEnd":427.3999996185303,"connectStart":427.3999996185303,"domainLookupEnd":427.3999996185303,"domainLookupStart":427.3999996185303,"fetchStart":427.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":592.3000001907349,"responseEnd":604.8999996185303,"responseStart":604.1999998092651,"secureConnectionStart":427.3999996185303},{"duration":182,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":427.5999994277954,"connectEnd":427.5999994277954,"connectStart":427.5999994277954,"domainLookupEnd":427.5999994277954,"domainLookupStart":427.5999994277954,"fetchStart":427.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":593.0999994277954,"responseEnd":609.5999994277954,"responseStart":608.6999998092651,"secureConnectionStart":427.5999994277954},{"duration":163.39999961853027,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":427.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":427.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":591.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":185.39999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":428,"connectEnd":428,"connectStart":428,"domainLookupEnd":428,"domainLookupStart":428,"fetchStart":428,"redirectEnd":0,"redirectStart":0,"requestStart":594.3999996185303,"responseEnd":613.3999996185303,"responseStart":612.5999994277954,"secureConnectionStart":428},{"duration":165.9000005722046,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":428.0999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":428.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":594,"responseStart":0,"secureConnectionStart":0},{"duration":195.79999923706055,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":428.30000019073486,"connectEnd":606.3000001907349,"connectStart":606.3000001907349,"domainLookupEnd":606.3000001907349,"domainLookupStart":606.3000001907349,"fetchStart":428.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":607.5,"responseEnd":624.0999994277954,"responseStart":618.6999998092651,"secureConnectionStart":606.3000001907349},{"duration":516.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":438,"connectEnd":438,"connectStart":438,"domainLookupEnd":438,"domainLookupStart":438,"fetchStart":438,"redirectEnd":0,"redirectStart":0,"requestStart":770.8999996185303,"responseEnd":954.3000001907349,"responseStart":947.3000001907349,"secureConnectionStart":438},{"duration":627.4000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":439.8999996185303,"connectEnd":439.8999996185303,"connectStart":439.8999996185303,"domainLookupEnd":439.8999996185303,"domainLookupStart":439.8999996185303,"fetchStart":439.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1054.5,"responseEnd":1067.3000001907349,"responseStart":1066.5,"secureConnectionStart":439.8999996185303},{"duration":255.39999961853027,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":832,"connectEnd":832,"connectStart":832,"domainLookupEnd":832,"domainLookupStart":832,"fetchStart":832,"redirectEnd":0,"redirectStart":0,"requestStart":1054,"responseEnd":1087.3999996185303,"responseStart":1086.5999994277954,"secureConnectionStart":832},{"duration":156.69999980926514,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1083,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1083,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1239.6999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":222,"domainLookupEnd":228,"connectStart":229,"connectEnd":248,"secureConnectionStart":237,"requestStart":250,"responseStart":421,"responseEnd":440,"domLoading":425,"domInteractive":1245,"domContentLoadedEventStart":1245,"domContentLoadedEventEnd":1294,"domComplete":2483,"loadEventStart":2484,"loadEventEnd":2484,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1216.3999996185303},{"name":"bigPipe.sidebar-id.end","time":1217.1999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1217.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1219.1999998092651},{"name":"activityTabFullyLoaded","time":1314.3999996185303}],"measures":[],"correlationId":"15a71b3884dd4","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":106,"dbReadsTimeInMs":14,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}