run_pipeline() never completes when the server side closes the connection during the pipeline; call_timeout and asyncio.wait_for don't end it
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- postgresql, python
调研方向
Start by tracing the async run_pipeline() implementation and how it handles socket closure, call timeouts, and task cancellation; the report gives a Python 3.12 Thin mode reproducer using connect_async. Reproduce with a TCP proxy that closes the connection after login, then compare the result with a direct database connection. Done when the pipeline raises on connection closure and timeout or cancellation ends the wait.
由索引模型根据 Issue 内容生成。
描述
Versions
- python-oracledb 4.0.1, Thin mode (
connect_async) - Python 3.12.3, Linux x86_64
- Oracle Database 23ai Free (container image), reached through a TCP proxy
What happens
The connection goes through a TCP proxy that inspects SQL. When the proxy refuses the request carrying the pipeline, it closes both TCP connections without sending a reply. await conn.run_pipeline(pipeline) then never returns or raises: there is no error and no result.
Ten seconds in, the client process holds no TCP socket to the proxy, only what looks like asyncio's internal socket pair. So python-oracledb has seen the close and dropped its socket, but the pending pipeline is never completed.
What we tried (each in its own process, killed by an outside timeout at 150 s):
| Setting | Result through the proxy | Direct to the database |
|---|---|---|
| none | no answer, killed at 150 s | 6 results, 0.2 s |
conn.call_timeout = 5000 |
no answer, 150 s | ok |
expire_time=1 |
no answer, 150 s | ok |
asyncio.wait_for(conn.run_pipeline(p), 10) |
no answer, 150 s (the cancellation hangs too) | ok |
call_timeout + expire_time |
no answer, 150 s | ok |
Expected
When the connection is closed while a pipeline is waiting for replies, run_pipeline() should raise (for example DPY-4011, "the database or network closed the connection"), as other calls on a closed connection do. call_timeout and task cancellation should also end the wait.
Repro sketch
- Put any TCP proxy between the client and a 23ai database that forwards the login, then closes both sides when it receives the first request after login.
- Run:
import asyncio, oracledb async def main(): conn = await oracledb.connect_async(user=..., password=..., dsn="proxyhost:port/FREEPDB1") p = oracledb.create_pipeline() for _ in range(6): p.add_fetchone("select 1 from dual") print(await conn.run_pipeline(p)) # never returns asyncio.run(main())
We can run a debug build or extra logging if that helps.
- 主要语言
- Python
- 星标
- 457
- 派生
- 120
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
oracle/python-oracledb 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 15/100
oracle/python-oracledb#629 ·
-
bug
难度 4/5 3-5 天 新手友好度 22/100
oracle/python-oracledb#628 ·
-
Thin mode: ORA-01483 for string binds of 2731-8191 bytes on a database with the UTF8 character set未关闭
难度 4/5 3-5 天 新手友好度 45/100
oracle/python-oracledb#627 · 1 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 75/100
oracle/python-oracledb#626 ·
-
bug
难度 4/5 3-5 天 新手友好度 48/100
oracle/python-oracledb#625 ·
查看 oracle/python-oracledb 的全部 Issue
相似的 Issue
-
documentation good first issue
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
MarketSquare/robotframework-browser#5479 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
endoflife-date/endoflife.date#11561 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
OCA/l10n-brazil#5602 ·
维护者通常 1 天内回复
-
documentation review-2.0.0
难度 2/5 1-3 小时 新手友好度 78/100
dkuenzel/meshcore-home-gateway#106 ·
维护者通常 1 天内回复