aio-libs / aio-libs/aiopg

ResourceWarning on parallel queries.

Đang mở
#697 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
1.4k
Fork
170
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.