Skip to content

Commit d481d8c

Browse files
committed
build: move to ontoenv 0.6.1
^0.6.0 -> ^0.6.1. The caret range already admitted 0.6.1; this raises the floor, because the release is entirely about the failure mode `_connect_recovering` exists to handle and the handler is only safe with it. 0.6.1 splits `.ontoenv/catalog.pending` into three states instead of two. Before, the marker's presence at open time meant `CatalogRecoveryError`, full stop. Now: a mutation that fails before touching the backend removes the marker on its way out rather than leaving one (the persisted catalog still describes the store, so there is nothing to recover); a marker whose writer still holds `.ontoenv/store.lock` is waited on for up to 2s and then raised as a plain retryable `ValueError` naming the external process; and only a marker with no live writer behind it is `CatalogRecoveryError`. That middle state is the one that matters here. `_connect_recovering` catches `CatalogRecoveryError` and rebuilds unconditionally, which under 0.6.0 could mean rebuilding a catalog another process was in the middle of writing -- the one destructive thing this code can do. 0.6.1 makes that unreachable, and the retryable error propagates untouched, which is correct: the answer to it is to retry, not to rebuild. No code change; the docstring now says so. Verified against 0.6.1 with a persistent cache: loading Brick (whose eight unresolvable imports were the original source of spurious markers) leaves no marker and opens #2 and #3 succeed with all 21 ontologies intact; a hand-written marker with no writer still raises `CatalogRecoveryError` and `OntoEnv.recover` clears it; a marker held by a thread holding an exclusive lock on store.lock raises `ValueError` after ~2.0s rather than `CatalogRecoveryError`. No API of ours changed and no new deprecation warnings: `connect`, `recover`, `UnresolvedImportError`, and `ViewGraph` are all as they were on 0.6.0. poetry.lock was regenerated by poetry 2.4.1 rather than the 2.1.1 that wrote it, so it also carries that generator header and two constraint spellings it normalizes (`jsonschema-specifications`, `PyYAML`); no other package moved.
1 parent 03c3ebb commit d481d8c

3 files changed

Lines changed: 25 additions & 15 deletions

File tree

buildingmotif/ontology_environment.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,17 @@ def _connect_recovering(
9090
a tolerated missing import now commits cleanly and leaves no marker, and
9191
``OntoEnv.recover`` rebuilds the catalog properly.
9292
93-
So reaching this handler now means a genuinely interrupted write, and
93+
0.6.1 narrowed the condition twice more, which is what makes catching
94+
it unconditionally safe: an operation that fails before writing
95+
anything no longer leaves a marker at all, and a marker still held by a
96+
*live* writer is reported as a retryable ``ValueError`` after a short
97+
wait rather than as ``CatalogRecoveryError``. Recovering an environment
98+
another process is actively writing would be the one genuinely
99+
destructive thing this method could do, and 0.6.1 is what rules it out;
100+
that error is left to propagate, since the answer to it is to retry,
101+
not to rebuild.
102+
103+
So reaching this handler means a genuinely interrupted write, and
94104
recovery is the supported answer to one. It is taken automatically
95105
because the alternative is a dead end: recovering a custom store
96106
requires passing that store, and ours does not exist until a

poetry.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ werkzeug="^2.3.7"
4141
types-jsonschema = "^4.21.0.20240311"
4242
matplotlib = "^3.9.2"
4343
pandas = "^2.2.3"
44-
ontoenv = "^0.6.0"
44+
ontoenv = "^0.6.1"
4545

4646
[tool.poetry.group.dev.dependencies]
4747
black = "^22.3.0"

0 commit comments

Comments
 (0)