Query deadlines can be disabled by `0`, are not capped by the run budget, and are not cancelled on session abort
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 18/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- mongodb, sql, sqlite, typescript
- Lĩnh vực
- backend, databases, performance
Hướng nghiên cứu
Start in packages/drivers/src/query-timeout.ts (parse() maps 0 to disabled) and the timeout message in packages/drivers/src/types.ts, then trace sql-materialize.ts where the deadline race and the missing ctx.abort handling live. Check packages/drivers/src/mongodb.ts for the cursor loop with no abort check. Done means a session abort returns within 2 s with the cursor closed, and per-call 0 cannot exceed the remaining budget.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
A single long tool call can outlive the run's soft and hard time budgets. The runner then kills the process and no answer or trace span survives.
Mechanism
0disables the deadline and the error text recommends it.parse()maps0to{ disabled: true }(packages/drivers/src/query-timeout.ts:36-40); the timeout error says "set query_timeout_ms ... (0 disables the deadline)" (packages/drivers/src/types.ts:74-75);sql_execute,sql_materializeandsql_checkadvertise it (sql-execute.ts:57-66,sql-materialize.ts:557). Clients with strict JSON schemas also send0as a filler value for unset optional fields.- No cap by remaining budget. Per-call deadlines are not clamped to the run's remaining time minus a finalization reserve.
- No cancellation.
sql-materialize.tsnever readsctx.abort;executeSourcepasses no signal (:239-260);sql-execute.ts:149-155passes none toDispatcher.call. The run's hard abort therefore cannot stop a running read. - Abandoned reads keep running. For remote sources the tool races the read against
deadline + 5 s(sql-materialize.ts:252-263) and rejects withcancelled: false, but the read continues (packages/drivers/src/mongodb.ts:379has no abort check; the cursor is closed only after the loop at:388). The error text then suggestsquery_timeout_ms: 0, so models start a second full read that competes with the first. Local SQLite/DuckDB engines get no outer timer at all (:247-249). - The runner's kill comes 60 s after the hard deadline (840 s inside 900 s), less startup time.
Evidence
- Retry reads with
query_timeout_ms: 0took 659.8, 658.9 and 674.8 s, started at about 143 s and ran through the soft deadline (672 s). - Reads that follow an abandoned attempt took a median 549 s versus 238 s for clean reads (37 vs 43 reads).
- In 5 sessions the hard deadline fired at 841-843 s, the abort never completed and the runner killed the run; in 2 more the abort arrived 35-53 s late.
- 19 sessions across recorded runs ended with no answer after a timeout of this shape; a scratch query with
query_timeout_ms: 0ran 428.6 s. - 1,095 of 2,685 (41%) of one client's SQL tool calls carried
query_timeout_ms: 0.
Impact
Answer-losing every time it triggers (a total loss, not a degraded answer). Estimated recoverable: 0-3 sessions per 270, more when combined with the Mongo cursor fix (#1479).
Proposed fix
- Clamp every tool deadline to
min(requested, remaining budget - finalization reserve); treat per-call0as "use default", reserving "disable" for connection configuration. - Thread an
AbortSignal(session abort plus deadline) throughDispatcherinto drivers; on timeout/abort close cursors (cursor.close()), cancel statements and kill the local helper. - Remove "(0 disables the deadline)" from agent-facing messages.
- Leave at least about 90 s between the hard deadline and the runner's kill.
Acceptance check
- Test: a session abort during a long
sql_materializereturns within 2 s and the cursor is closed. - Test:
query_timeout_ms: 0on a call does not exceed the remaining budget. - Test: after a timeout, no further documents are fetched from the abandoned cursor.
Related: #1479 (Mongo byte-bounded reads fetched one document per round trip; fix in #1480).
- Ngôn ngữ chính
- TypeScript
- Star
- 810
- Fork
- 121
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 89
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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.
Issue khác của AltimateAI/altimate-code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AltimateAI/altimate-code#1454 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
test: MCP tests fail when the developer's ~/.claude.json has MCP servers (HOME is not sandboxed)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
AltimateAI/altimate-code#1386 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
AltimateAI/altimate-code#1384 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
AltimateAI/altimate-code#1323 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
AltimateAI/altimate-code#1288 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của AltimateAI/altimate-code
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
521xueweihan/HelloGitHub#4025 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
voidzero-dev/void#478 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
Small-tailqwq/dsh-deep-whale#207 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The inspector never shows the instances field, so scaling out is unreachableCó thể đã có người làm @Mrkewl đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
xevrion/breakscale#96 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Flux159/mcp-server-kubernetes#384 ·