MagicStack / MagicStack/asyncpg
cannot switch to state 15; another operation (2) 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.23.0
* **PostgreSQL version**: Aurora PostgreSQL 10.14
* **Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?**: RDS Aurora (and hard to repro)
* **Python version**: 3.9
* **Platform**: Linux
* **Do you use pgbouncer?**: no
* **Did you install asyncpg with pip?**: pip3.9 install --user
* **If you built asyncpg locally, which version of Cython did you use?**:
* **Can the issue be reproduced under both asyncio and [uvloop](https://github.com/magicstack/uvloop)?**: repro'd with uvloop
```
File "/root/.local/lib/python3.9/site-packages/asyncpg/pool.py", line 792, in __aexit__
await self.pool.release(con)
File "/root/.local/lib/python3.9/site-packages/asyncpg/pool.py", line 666, in release
return await asyncio.shield(ch.release(timeout))
File "/usr/lib/python3.9/asyncio/futures.py", line 284, in __await__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.9/asyncio/tasks.py", line 328, in __wakeup
future.result()
File "/usr/lib/python3.9/asyncio/futures.py", line 201, in result
raise self._exception
File "/usr/lib/python3.9/asyncio/tasks.py", line 256, in __step
result = coro.send(None)
File "/root/.local/lib/python3.9/site-packages/asyncpg/pool.py", line 218, in release
raise ex
File "/root/.local/lib/python3.9/site-packages/asyncpg/pool.py", line 208, in release
await self._con.reset(timeout=budget)
File "/root/.local/lib/python3.9/site-packages/asyncpg/connection.py", line 1311, in reset
await self.execute(reset_query, timeout=timeout)
File "lib/common.py", line 164, in execute
return await self._with_logger(super(PSQLLoggerMixin, self).execute)(*args, **kwargs)
File "lib/common.py", line 119, in wrapper
ret_val = await func(*args, **kwargs)
File "/root/.local/lib/python3.9/site-packages/asyncpg/connection.py", line 297, in execute
return await self._protocol.query(query, timeout)
File "asyncpg/protocol/protocol.pyx", line 338, in query
File "/usr/lib/python3.9/asyncio/futures.py", line 287, in __await__
return self.result() # May raise too.
File "/usr/lib/python3.9/asyncio/futures.py", line 201, in result
raise self._exception
File "asyncpg/protocol/protocol.pyx", line 331, in asyncpg.protocol.protocol.BaseProtocol.query
File "asyncpg/protocol/coreproto.pyx", line 1061, in asyncpg.protocol.protocol.CoreProtocol._simple_query
File "asyncpg/protocol/coreproto.pyx", line 768, in asyncpg.protocol.protocol.CoreProtocol._set_state
asyncpg.exceptions._base.InternalClientError: cannot switch to state 15; another operation (2) is in progress
```
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 với asyncpg/pool.py quanh release, asyncpg/connection.py quanh reset và asyncpg/protocol/coreproto.pyx quanh _set_state. Xem lại traceback và điều tra đường đi của thao tác đồng thời, lưu ý rằng sự cố được báo cáo khó tái hiện và đã được thấy với uvloop và Aurora PostgreSQL. Được xem là hoàn tất khi nguyên nhân có thể tái hiện hoặc được giải thích và lỗi chuyển trạng thái được khắc phục mà không làm hỏng việc giải phóng kết nối.
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
- 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