Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection, returned to pool, should not be usable #288

Open
themylogin opened this issue Mar 25, 2017 · 2 comments
Open

Connection, returned to pool, should not be usable #288

themylogin opened this issue Mar 25, 2017 · 2 comments

Comments

@themylogin
Copy link
Contributor

The following bug lived in our service for many month, once a few days producing strange error messages. I've even fixed a real bug in aiopg trying to figure out what is going on:

async with request.app["db"].acquire() as db:
    await func1(db)

await func2(db)

Connection has been returned to pool, but is still being used outside of pool management logic. This can lead to various concurrency conflicts.

In my opinion, connections that are managed by the pool, should have some flag that either issues warning or raises exception that prevents using them this way. If community agrees, I can implement this and issue a pull-request.

@jettify
Copy link
Member

jettify commented Mar 29, 2017

I think it is good idea! asyncpg doing similar thing MagicStack/asyncpg#99

@iasemin
Copy link

iasemin commented Jun 8, 2020

Hello!

what about this issue? in version 1.0.0 this bug fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants