Repository navigation
Conversation
| .ok_or_else(|| invalid("Debugger resources released"))?; | ||
| let mut failures = vec![]; | ||
| let mut retained = vec![]; | ||
| for (id, bp) in control.breakpoints.drain(..) { |
There was a problem hiding this comment.
WARNING: Breakpoint tracking is lost if a native call fails mid-update
control.breakpoints.drain(..) removes every entry from the tracked list up front, but the loop body can return early through ? (the connection.execute(...)? and bind_value(...)? calls). When that happens, the remaining drained entries are dropped and control.breakpoints is never reassigned from retained. The native breakpoints stay set in the Oracle session, but the plugin no longer tracks them, so they can't be deleted by a later set_breakpoints and the reported breakpoints snapshot no longer matches the native state.
A failed delete also keeps the old breakpoint in retained, and the loop below then re-adds the same line, which can create a duplicate native breakpoint on that line.
Suggestion: iterate over a copy (std::mem::take into a local and restore on error) or collect errors instead of using ? inside the loop, and skip re-adding lines that are already retained.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge No changes since the previously reviewed commit, and the earlier review found no issues. I did not run the tests. Files Reviewed (0 files in incremental diff)
Previous Review Summaries (5 snapshots, latest commit 05341d1)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 05341d1)Status: No Issues Found | Recommendation: Merge The incremental changes since
Files Reviewed (8 files in incremental diff)
Previous review (commit 838903c)Status: No Issues Found | Recommendation: Merge The incremental changes add handling for Files Reviewed (5 files in incremental diff)
Previous review (commit 30219da)Status: No Issues Found | Recommendation: Merge The incremental changes add a discard path for never-started previews. Files Reviewed (3 files in incremental diff)
Previous review (commit 0ff9536)Status: No Issues Found | Recommendation: Merge The previous warning (breakpoint tracking lost on native call failure in Files Reviewed (3 files in incremental diff)
Previous review (commit b3d37a8)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (11 files)
Reviewed by claude-sonnet-5.5 · Input: 250 · Output: 786 · Cached: 164.8K |
|
Thanks for the contribution. This is a solid foundation: isolated target/controller sessions, bound inputs, and conservative transaction reporting are good choices. The host-side support has already landed in TabularisDB/tabularis#1460. I reviewed head
Validation: the existing 55 unit tests and two doctests passed locally. The live Oracle tests were skipped locally because Once these two cancellation cases are covered, I would be comfortable moving this forward as an alpha release. |
Handle the host `cancel` notification (with `$/cancelRequest` as an alias) without emitting a response, and record Stop against a reserved start so preparation cannot activate after cancellation.
|
Addressed both P1s from review of
|
debba
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround. I re-reviewed 838903c: CI is green upstream (except the version-suggestion label, which I've now added), and I ran the binary end to end against Oracle Free 26ai with a least-privileged user. Both earlier P1s are fixed: the host cancel notification interrupts in-flight requests without replying, and Stop during preparation prevents activation and releases both connections. Breakpoints, all step modes, frame-scoped variables, OUT/return values, rollback, EOF cleanup and identifier/bind safety all behaved correctly.
Two new issues need fixing before merge:
-
[P1] Ordinary requests block Stop. In
src/main.rs:69-73, non-debugger requests still run on the stdin thread. When a paused target holds a row lock (normal mid-debug) and the user runsUPDATEon that row from the editor,execute_querywaits on the lock, and the plugin stops reading stdin. In my run, Stop was answered only after 119 s, when the abandoned-session lease aborted the target. The host's 5 s stop timeout and itscancelnotifications can't get through. Please read stdin on its own thread, dispatchcancelandroutine_debugimmediately, and queue ordinary requests to a single sequential worker so their ordering is preserved. A live regression test (pause after an UPDATE, send a conflictingexecute_query, then Stop) should return within a few seconds. -
[P1] Without the object DEBUG privilege, Start runs the routine to completion. A user with EXECUTE but no DEBUG on another schema's routine gets no native stop, so
reach_entry(src/debugger/session.rs:189-215) lets the call finish. Against a routine that INSERTs and COMMITs, Start returnedexecution: completedand the row was committed. That contradicts "stop at entry" in the protocol and README. Please check DEBUG access during preview/start (owner, object DEBUG, or DEBUG ANY PROCEDURE) and fail with a clear message. As a backstop, at the first wrapper stop, install a native breakpoint in the target and abort execution if that fails or the next stop isn't in the target. Please add a live test with a non-owner account.
Non-blocking, happy to take these as follow-ups:
- The fixed 3 s call timeout and 1 s DBMS_DEBUG wait make cold or slow databases flaky: 2 of my first 4 live runs failed (DPI-1067 on start, and
continuereturningrunningattests/live_debugger.rs:316). Consider configurable or longer timeouts, and have the test pollstatus. - Stop during preparation replies
resources: releasedwhile a connection is still open. - Cancelling a read-only request (status/read_stack) stops the whole session.
- The 120 s idle lease ends a session while a user is just reading code at a breakpoint.
startedis capped at 1024 and never pruned.- A preview can be started again under a new session ID.
- Missing or invalid routines surface as "no data found".
- Please add a CHANGELOG
[Unreleased]entry, and either note that only 23ai/26ai was validated or soften the "19c+" claim.
- Read stdin on its own thread: cancel and routine_debug dispatch immediately, ordinary requests run in order on one worker, so a query blocked on a paused target's row lock no longer delays Stop. - Preview checks DEBUG access (owner, object DEBUG or DEBUG ANY PROCEDURE). As a backstop, the first wrapper stop arms a native breakpoint in the target and aborts if that fails or the next stop is elsewhere, so Start can never run the routine to completion. - Review follow-ups: longer call/event timeouts and status polling in live tests, honest resources state for Stop during preparation, cancelling read-only requests no longer stops the session, 30-minute lease while paused, pruned start reservations, single-use previews, clear message for missing/invalid routines, CHANGELOG entry and 23ai/26ai validation note. - Live tests: Stop with a conflicting execute_query, non-owner with and without DEBUG.
05341d1 to
a444c7a
Compare
|
Thanks for the thorough re-review! Both P1s and the non-blocking follow-ups are addressed in P1: Ordinary requests block Stop
P1: Start without object DEBUG runs the routine to completion
Follow-ups
The new live tests are only exercised in CI (no local Oracle instance on my side), so I'll keep an eye on the |
Behaviour
Adds native PL/SQL routine debugging for TabularisDB/tabularis#1411 through the optional
routine_debug: 1driver contract. Preview reads the selected standalone routine and bound inputs; explicit start stops at its entry. Dedicated target/controller sessions support continue, step into/over/out, native breakpoints, stack reads, scalar watches, and OUT/return values.Companion host PR: TabularisDB/tabularis#1460.
The debugger never grants privileges, recompiles routines or creates persistent helpers. Starts are deduplicated before connection setup. Stop, cancellation, EOF and an abandoned-session lease interrupt execution and clean up both connections. Execution, overall transaction outcome and resource release are independent; COMMIT, DDL, autonomous transactions and external effects cannot be undone by the debugger. Remaining uncommitted work is rolled back and overall transaction outcome stays conservatively unknown.
Scope
Validation
cargo clippy --all-targets -- -D warningspass. Regression tests inject failed breakpoint removals/additions, verify retained handles remain removable and prevent duplicate installations, and check idempotent disposal of unused previews; the live test also replaces an existing breakpoint with a duplicated request.tests/live_debugger.rsadds real stdio integration tests to the existing Oracle Free CI job: breakpoints, all step modes, stack/watches, OUT/return values, exception, duplicate start, concurrent stop, EOF, source changes, missing privileges/debug info, unsupported types, rollback and absence of leaked target/controller sessions. Oracle/Instant Client versions are logged.30219da86070ce40750a192811aef6bd6254d847: live Oracle job, Oracle AI Database 26ai Free23.26.3.0.0/ Instant Client23.26.2.0.0.ORACLE_TEST_HOSTwas set, so the native test ran rather than skipping. It confirmed unused preview disposal without execution, an entry stop before the routine's INSERT, breakpoint replacement/deduplication, step/variable inspection, numeric OUT/function return values, exception, cancellation, EOF, rollback and release of target/controller sessions.ORACLE_TEST_HOST; other Oracle versions have not been validated.Maintainer action: please apply the existing
prerelease:alphalabel required by the version-suggestion job. The fork author cannot assign upstream labels.