aio-libs / aio-libs/aiopg

ResourceWarning on parallel queries.

未關閉
#697 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
1.4k
分支
170
PR 合併指標
30 天內沒有已合併 PR

描述

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

```python
...
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:
```shell
...
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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。