MagicStack / MagicStack/asyncpg
Trying to debug `asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress`
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 8.1k
- Fork
- 468
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
- asyncpg version: 0.20.1
- PostgreSQL version: 12
- Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?: no - Python version: 3.7.5
- Platform: OS X
- Do you use pgbouncer?: no
- Did you install asyncpg with pip?: yes
- If you built asyncpg locally, which version of Cython did you use?: -
- Can the issue be reproduced under both asyncio and
uvloop?: yes
Hi!
I'm trying to debug an issue that I have with errors like asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress from this line: https://github.com/MagicStack/asyncpg/blob/dcef29804095990f25178b642b920f3fbcb4ca22/asyncpg/protocol/protocol.pyx#L664
I am trying to understand where I could have gone wrong. So, I would like to ask the following preliminary question:
Suppose my code interacts with asyncpg only through a pool, and only using context managers:
async with pool.acquire() as connection:
...
I also do not share the connection object around. On it, I use the methods fetchrow, fetchval and fetch. They are used sequentially from the same asyncio "thread" (for lack of better word). That is to say, they are never called in parallel.
In this setup, I would think that the error cannot perform operation: another operation is in progress never shows up, but it does. Am I missing something?
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách đọc asyncpg/protocol/protocol.pyx quanh dòng 664, sau đó lần theo ngữ cảnh pool.acquire và các lệnh gọi tuần tự fetchrow, fetchval và fetch được mô tả trong báo cáo. Hãy thử thu gọn hành vi thành một ví dụ có thể tái hiện bằng asyncio và uvloop. Công việc được xem là hoàn tất khi xác định được thao tác xung đột hoặc ghi lại các chi tiết tái hiện còn thiếu cần thiết để chẩn đoán vấn đề.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- postgresql, python
- Lĩnh vực
- backend, databases
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100