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

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

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

apps/project_bookclub/mix.exs:50 and apps/query_bookclub/mix.exs:33 ask for {:esqlite, "~> 0.9"}, and the repo commits no mix.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: the Erlang twin's fix (macula-services/mcl-bookclub#15, PR 16) catches q/3's {case_clause, '$busy'} and relies on q/3 having finalized the statement. The fix for #28 here takes the same shape. On 0.9.x the statement is left for garbage collection while the connection is busy, which froze a scheduler in the twin's superseded attempt.

Done when: both apps require esqlite >= 0.10.0, e.g. ~> 0.10, and the build still resolves 0.10.1.

Refs #28. The Erlang twin is filed beside this one.

Purpose (fix): the query store's busy answer (#28) runs only on an esqlite whose q/3 finalizes its statement, so the dependency cannot resolve to one that does not. apps/project_bookclub/mix.exs:50 and apps/query_bookclub/mix.exs:33 ask for `{:esqlite, "~> 0.9"}`, and the repo commits no mix.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: the Erlang twin's fix (macula-services/mcl-bookclub#15, PR 16) catches q/3's `{case_clause, '$busy'}` and relies on q/3 having finalized the statement. The fix for #28 here takes the same shape. On 0.9.x the statement is left for garbage collection while the connection is busy, which froze a scheduler in the twin's superseded attempt. Done when: both apps require esqlite >= 0.10.0, e.g. `~> 0.10`, and the build still resolves 0.10.1. Refs #28. The Erlang twin is filed beside this one.
Member

Landed with PR 29, main 04efa992f8 (57cafbf): esqlite ~> 0.10 in project_bookclub and query_bookclub mix.exs. mix.lock already held 0.10.1. Erlang twin: macula-services/mcl-bookclub#17 (8b1c120f).

Landed with PR 29, main 04efa992f87210a3a92f52e93808b04dee4ca6f2 (57cafbf): esqlite ~> 0.10 in project_bookclub and query_bookclub mix.exs. mix.lock already held 0.10.1. Erlang twin: macula-services/mcl-bookclub#17 (8b1c120f).
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-phoenix#30
No description provided.