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

ResourceWarning on parallel queries. #697

Open
vsadriano opened this issue Jul 8, 2020 · 0 comments
Open

ResourceWarning on parallel queries. #697

vsadriano opened this issue Jul 8, 2020 · 0 comments

Comments

@vsadriano
Copy link

vsadriano commented Jul 8, 2020

Hi! I've multiple parallel queries running on postgres and all query functions follow the pattern:

...
sql = $ANY_SQL_QUERY

async with dbpool.acquire() as conn:
    async with conn.cursor() as cursor:
        await cursor.execute(sql, (project,))
        rows = await cursor.fetchall()
        return[Bucket(*row) for row in rows] if rows else None
...

I'm getting the error message bellow:

...
2020-07-07 15:09:19,012 INFO: Obtendo a lista de PVC para a namespace cpfdigital-p...
/opt/python/venv/lib/python3.7/site-packages/aiopg/pool.py:245: ResourceWarning: Invalid transaction status on released connection: 1
  ResourceWarning
...

I think this is caused by failure on close or release connections but I thought that aiopg connection pool was responsible by this action.

Do I need to write the release, or closing, of connections for each run? What is the impact of this approach for aiopg connection pool?

Context:
Python3.7
aiohttp 3.6.2
aiopg 1.0.0
postgres 11

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

1 participant