Skip to content

v0.9.1 — set_embedder_named works with the worker pool running

Choose a tag to compare

@spranab spranab released this 29 Jun 19:46

v0.9.1 — patch

Fixes a v0.9.0 regression (#58): set_embedder_named() always failed with "requires exclusive access to the engine", regardless of the model name.

Root cause

v0.9.0 made the pyo3 constructors spawn a background worker pool (materializer + compactor). Each worker thread holds a Weak<YantrikDB>, and set_embedder_named reaches the engine via Arc::get_mut, which requires strong count == 1 AND weak count == 0. The workers'' weak refs alone tripped that guard — so the named / multilingual embedder-swap path was broken.

Fix

The binding now stops the worker pool (dropping the guards joins the threads, releasing the weak refs), performs the swap with exclusive access, then respawns the pool. No engine API change; fixes both construct-then-swap and runtime swaps; the original error is preserved for genuine external ConnectionProxy / clone leaks.

Impact

Unblocks the multilingual backend in yantrikdb-mcp#14 — its xfail''d e2e passes once this is published, with no further code change.

Published to PyPI (pip install -U yantrikdb) and crates.io (yantrikdb).