Skip to content

sql(postgres): ref poll_ref only after request is enqueued in do_run - #32273

Closed
robobun wants to merge 3 commits into
mainfrom
farm/944b7509/postgres-do-run-pollref-leak
Closed

sql(postgres): ref poll_ref only after request is enqueued in do_run#32273
robobun wants to merge 3 commits into
mainfrom
farm/944b7509/postgres-do-run-pollref-leak

sql(postgres): ref poll_ref only after request is enqueued in do_run

78ea1c4
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 15, 2026 in 14m 15s

Code review found 1 potential issue

Found 4 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 0
🟣 Pre-existing 1
Severity File:Line Issue
🟣 Pre-existing src/sql_jsc/postgres/PostgresSQLQuery.rs:857-859 Pre-existing: three do_run error paths still leak the speculative this.ref_()

Annotations

Check notice on line 859 in src/sql_jsc/postgres/PostgresSQLQuery.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Pre-existing: three do_run error paths still leak the speculative this.ref_()

Pre-existing: three error paths in the prepared-statement branch still leak the speculative `this.ref_()` taken near the top of `do_run` — the `statements.get_or_put` Err arm (line 632), the `writer.write(&protocol::SYNC)` Err arm (line 783), and this final `requests.write_item` OOM (which also leaks the just-allocated `this.statement`). Every sibling error path explicitly calls `Self::deref(this_ptr)`; the PR description's claim that "every synchronous error return … undoes the speculative `thi