ResourceWarning on parallel queries.
- 主要語言
- 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 還沒有評估資料。