You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using an on_connect callback, it appears to get called every time a connection is aquired, rather than every time a new connection is made, which appears to differ from the stated documentation:
on_connect – a callback coroutine executed at once for every created connection. May be used for setting up connection level state like client encoding etc.
Although it looks like it was intended to put one of 'least' or 'most' between the 'at' and 'once'?
This is due to the callback check being made in the acquire code:
The test case here currently doesn't catch this, as it only checks the call is made once. Perhaps it should instead check that when reusing a connection, the on_connect callback isn't called multiple times, maybe by using a pool with minsize = maxsize = 1 and acquiring the connection twice?
The text was updated successfully, but these errors were encountered:
GitMate.io thinks possibly related issues are #141 (Add an on_connect callback parameter to pool), #16 (Add timeout for acquiring from pool), #130 (Implement timeout on acquiring connection from pool), #113 (Can't acquire connection from pool), and #335 (pool.acquire() function is not thread safe).
When using an
on_connect
callback, it appears to get called every time a connection is aquired, rather than every time a new connection is made, which appears to differ from the stated documentation:Although it looks like it was intended to put one of 'least' or 'most' between the 'at' and 'once'?
This is due to the callback check being made in the acquire code:
aiopg/aiopg/pool.py
Lines 165 to 180 in 9fdf7b9
Should this instead be located after the new connection is made in
_fill_free_pool
: https://github.com/aio-libs/aiopg/blob/master/aiopg/pool.py#L199The test case here currently doesn't catch this, as it only checks the call is made once. Perhaps it should instead check that when reusing a connection, the
on_connect
callback isn't called multiple times, maybe by using a pool withminsize = maxsize = 1
and acquiring the connection twice?The text was updated successfully, but these errors were encountered: