Broken error reporting through Python ADBC
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
调研方向
通过 Python ADBC DBAPI 路径复现该查询,从 cur.execute 和游标关闭路径开始。跟踪 Flight SQL Action::SelectPreparedStatement 错误以及随后对 ClosePreparedStatement 的处理。当除以零能被及时报告,且不再出现 traceback 中显示的会话被窃取和清理错误时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
The following query should report a division by zero:
import adbc_driver_flightsql.dbapi as flight_sql
with flight_sql.connect(uri="grpc://localhost:15432",
db_kwargs={"username": "avogelsgesang",
"adbc.flight.sql.rpc.call_header.x-flight-sql-database": "avogelsgesang"
}
) as conn:
with conn.cursor() as cur:
cur.execute("SELECT 1/0;")
However, this does not work as expected. Instead cur.execute first hangs for a couple of minutes before then reporting
Traceback (most recent call last):
File "/home/avogelsgesang/Documents/af-query.py", line 9, in <module>
cur.execute("SELECT 1/0;")
File "/home/avogelsgesang/.local/lib/python3.10/site-packages/adbc_driver_manager/dbapi.py", line 669, in execute
handle, self._rowcount = self._stmt.execute_query()
File "adbc_driver_manager/_lib.pyx", line 1106, in adbc_driver_manager._lib.AdbcStatement.execute_query
File "adbc_driver_manager/_lib.pyx", line 227, in adbc_driver_manager._lib.check_error
adbc_driver_manager.ProgrammingError: INVALID_ARGUMENT: [FlightSQL] failed to run: Action::SelectPreparedStatement: division by zero (InvalidArgument; ExecuteQuery)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/avogelsgesang/Documents/af-query.py", line 8, in <module>
with conn.cursor() as cur:
File "/home/avogelsgesang/.local/lib/python3.10/site-packages/adbc_driver_manager/dbapi.py", line 225, in __exit__
self.close()
File "/home/avogelsgesang/.local/lib/python3.10/site-packages/adbc_driver_manager/dbapi.py", line 611, in close
self._stmt.close()
File "adbc_driver_manager/_lib.pyx", line 1078, in adbc_driver_manager._lib.AdbcStatement.close
File "adbc_driver_manager/_lib.pyx", line 1084, in adbc_driver_manager._lib.AdbcStatement.close
File "adbc_driver_manager/_lib.pyx", line 227, in adbc_driver_manager._lib.check_error
adbc_driver_manager.ProgrammingError: INVALID_ARGUMENT: [FlightSQL] stolen session: 1283150246607583965 (InvalidArgument; ClosePreparedStatement)
Exception ignored in: <function Cursor.__del__ at 0x7fa517960280>
Traceback (most recent call last):
File "/home/avogelsgesang/.local/lib/python3.10/site-packages/adbc_driver_manager/dbapi.py", line 766, in __del__
File "/home/avogelsgesang/.local/lib/python3.10/site-packages/adbc_driver_manager/dbapi.py", line 611, in close
File "adbc_driver_manager/_lib.pyx", line 1077, in adbc_driver_manager._lib.AdbcStatement.close
File "adbc_driver_manager/_lib.pyx", line 293, in adbc_driver_manager._lib._AdbcHandle._close_child
File "adbc_driver_manager/_lib.pyx", line 295, in adbc_driver_manager._lib._AdbcHandle._close_child
RuntimeError: Underflow in closing this AdbcStatement
- 主要语言
- C++
- 星标
- 116
- 派生
- 10
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/arrow-flight-sql-postgresql 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 30/100
apache/arrow-flight-sql-postgresql#190 · 26 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 38/100
apache/arrow-flight-sql-postgresql#189 · 1 条评论 ·
-
Use correct attribution in the footer of documentation pages可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 1/5 1 小时以内 新手友好度 35/100
apache/arrow-flight-sql-postgresql#185 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 5/5 一周以上 新手友好度 25/100
apache/arrow-flight-sql-postgresql#177 · 2 条评论 ·
查看 apache/arrow-flight-sql-postgresql 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
Qiskit/qiskit-aer#2466 ·
-
feature request
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
status:needs-triage
难度 2/5 1-3 小时 新手友好度 88/100
PX4/PX4-Autopilot#29006 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
Segfault in pwStreamAddBuffer: createBuffer() returning nullptr is dereferenced (Screencopy.cpp:943)未关闭
难度 2/5 1-3 小时 新手友好度 74/100