Broken error reporting through Python ADBC
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Reproduce the query through the Python ADBC DBAPI path, starting at cur.execute and the cursor close path. Trace the Flight SQL Action::SelectPreparedStatement error and the subsequent ClosePreparedStatement handling. Done means division by zero is reported promptly without the stolen-session and cleanup errors shown in the traceback.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- C++
- Stars
- 116
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/arrow-flight-sql-postgresql
-
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
apache/arrow-flight-sql-postgresql#190 · 26 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
apache/arrow-flight-sql-postgresql#189 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 35/100
apache/arrow-flight-sql-postgresql#185 · 1 comment ·
-
Improve timeout case Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/arrow-flight-sql-postgresql#177 · 2 comments ·
All issues in apache/arrow-flight-sql-postgresql
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100