MagicStack / MagicStack/asyncpg
AttributeError: 'NoneType' object has no attribute 'cancelled'
Đang mở
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.14.0
- PostgreSQL version: 9.6.6
- Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?: I can't reproduce - Python version: 3.6.4
- Platform: Alpine Linux
- Do you use pgbouncer?: Yes
- Did you install asyncpg with pip?: Yes
- If you built asyncpg locally, which version of Cython did you use?: 0.27.3
- Can the issue be reproduced under both asyncio and
uvloop?: No
Same query sometimes breaks with this, meaning the exact query other times works flawlessly, any ideas?
[06:06:23][ERROR] robbie.http.microservice.middleware.errors api.py:__call__:242 | ("Non SQL error happened: 'NoneType' object has no attribute 'cancelled'", AttributeError("'NoneType' object has no attribute 'cancelled'",))
Traceback (most recent call last):
File "robbie/sql/postgresql/utils.py", line 119, in robbie.sql.postgresql.utils.sql_exceptions_handler.wrapper
File "robbie/sql/postgresql/client.py", line 119, in fetch
File "/usr/local/lib/python3.6/site-packages/asyncpg/pool.py", line 405, in fetch
return await con.fetch(query, *args, timeout=timeout)
File "/usr/local/lib/python3.6/site-packages/asyncpg/connection.py", line 345, in fetch
return await self._execute(query, args, 0, timeout)
File "/usr/local/lib/python3.6/site-packages/asyncpg/connection.py", line 1289, in _execute
query, args, limit, timeout, return_status=return_status)
File "/usr/local/lib/python3.6/site-packages/asyncpg/connection.py", line 1297, in __execute
return await self._do_execute(query, executor, timeout)
File "/usr/local/lib/python3.6/site-packages/asyncpg/connection.py", line 1312, in _do_execute
stmt = await self._get_statement(query, timeout)
File "/usr/local/lib/python3.6/site-packages/asyncpg/connection.py", line 286, in _get_statement
statement = await self._protocol.prepare(stmt_name, query, timeout)
File "asyncpg/protocol/protocol.pyx", line 168, in prepare
File "asyncpg/protocol/coreproto.pyx", line 122, in asyncpg.protocol.protocol.CoreProtocol._read_server_messages
File "asyncpg/protocol/coreproto.pyx", line 625, in asyncpg.protocol.protocol.CoreProtocol._push_result
File "asyncpg/protocol/protocol.pyx", line 818, in asyncpg.protocol.protocol.BaseProtocol._on_result
File "asyncpg/protocol/protocol.pyx", line 745, in asyncpg.protocol.protocol.BaseProtocol._dispatch_result
AttributeError: 'NoneType' object has no attribute 'cancelled'
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 việc lần theo traceback qua asyncpg/pool.py, connection.py và các tệp protocol, tập trung vào đường dẫn phân phối kết quả nơi cancelled được truy cập. Vì báo cáo không có cách tái hiện, trước tiên hãy thu hẹp các điều kiện tạo ra giá trị None dưới asyncio và uvloop, sau đó thêm một regression test cho thấy truy vấn hoàn tất mà không có AttributeError này.
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