The esqlite floor ~> 0.9 admits a q/3 that never finalizes its statement #17

Closed
opened 2026-12-01 20:21:59 +00:00 by jupiter · 1 comment
Member

Purpose (fix): the query store's busy answer (#15) runs only on an esqlite whose q/3 finalizes its statement, so the dependency cannot resolve to one that does not.

rebar.config:63 asks for {esqlite, "~> 0.9"}, and the repo commits no rebar.lock. That range admits 0.9.x. In esqlite 0.9.0, q/3 runs prepare, bind and fetchall with no after, so the statement is not finalized when fetchall raises. 0.10.0 and 0.10.1 wrap it in try ... after finalize_query_statement(Statement).

The instance that exposed it: PR 16 (#15, landing) answers a held lock by catching q/3's {case_clause, '$busy'}. Its comment and the review rely on q/3 having finalized the statement before it returns. On 0.9.x the statement is left for garbage collection while the connection is busy. That is the scheduler freeze that superseded 5e88df2 on PR 16. CI resolves 0.10.1 today, so nothing fails yet.

Done when: the root rebar.config requires esqlite >= 0.10.0, e.g. ~> 0.10, and the build still resolves 0.10.1.

Refs #15. The Phoenix twin is filed beside this one.

Purpose (fix): the query store's busy answer (#15) runs only on an esqlite whose q/3 finalizes its statement, so the dependency cannot resolve to one that does not. rebar.config:63 asks for `{esqlite, "~> 0.9"}`, and the repo commits no rebar.lock. That range admits 0.9.x. In esqlite 0.9.0, q/3 runs prepare, bind and fetchall with no `after`, so the statement is not finalized when fetchall raises. 0.10.0 and 0.10.1 wrap it in `try ... after finalize_query_statement(Statement)`. The instance that exposed it: PR 16 (#15, landing) answers a held lock by catching q/3's `{case_clause, '$busy'}`. Its comment and the review rely on q/3 having finalized the statement before it returns. On 0.9.x the statement is left for garbage collection while the connection is busy. That is the scheduler freeze that superseded 5e88df2 on PR 16. CI resolves 0.10.1 today, so nothing fails yet. Done when: the root rebar.config requires esqlite >= 0.10.0, e.g. `~> 0.10`, and the build still resolves 0.10.1. Refs #15. The Phoenix twin is filed beside this one.
mercurius referenced this issue from a commit 2026-12-01 20:27:24 +00:00
Member

Landed: PR 18, main 8b1c120f6e. rebar.config now asks esqlite ~> 0.10, so the build cannot pick 0.9.0, whose q/3 does not finalize its statement (the #15 fix relies on it).

Landed: PR 18, main 8b1c120f6e2d0ae66a62ae0e31175d039efb26ba. rebar.config now asks esqlite ~> 0.10, so the build cannot pick 0.9.0, whose q/3 does not finalize its statement (the #15 fix relies on it).
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
macula-services/mcl-bookclub#17
No description provided.