fix: stop witness start double-opening the reg LMDB env (1.3 line) - #11
Closed
dhh1128 wants to merge 1 commit into
Closed
fix: stop witness start double-opening the reg LMDB env (1.3 line)#11dhh1128 wants to merge 1 commit into
dhh1128 wants to merge 1 commit into
Conversation
`kli witness start` on this 1.3 line aborts at "Starting witness..." with `lmdb.Error: The environment '.../reg/witness' is already open in this process`. Two independent code paths open the same reg (credential registry) LMDB path in one process, which LMDB forbids: 1. QueryEnd.__init__ created its OWN `Reger(name=hab.name, …)` on the same reg path as setupWitness's shared reger. Fix: thread the shared reger into QueryEnd (QueryEnd(hab, reger)) and reuse it, exactly as keri main does. 2. LMDBer.reopen() called lmdb.open() without first closing an already-open env, so reopening the reg via its BaserDoer opened a second handle on the same path. Fix: close self.env (best-effort) and null it before re-opening, making reopen() idempotent — again matching keri main. Both are backports of the corresponding keri-main changes. With them the witness boots cleanly and the closure qualifies through the witness-qualifier bar. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Daniel Hardman <daniel.hardman@gmail.com>
Member
Author
|
Superseded by WebOfTrust#1536 — the fix belongs upstream against WebOfTrust/keripy's v1.3.5 branch (from a personal fork), not the provenant-dev fork. Closing here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On this 1.3 line,
kli witness startaborts at "Starting witness..." with:Two independent code paths open the same
reg(credential registry) LMDB path in one process, which LMDB forbids:QueryEnd.__init__created its ownReger(name=hab.name, …)on the same reg path assetupWitness's sharedreger— a second env handle for the same path.LMDBer.reopen()calledlmdb.open()without first closing an already-open env, so reopening the reg via itsBaserDoeropened a second handle on the same path.Fix (both are backports of what
kerimain already does)QueryEnd—QueryEnd(hab, reger)reuses it instead of opening a second env (setupWitnessnow passesreger=reger).LMDBer.reopen()idempotent — closeself.env(best-effort) and null it before re-opening.Validation
Built a witness image from this branch (
keri@ this fix + hio 0.7.19 + Python 3.14.5) and ran it:Starting witness...→ thelmdb.Errorabove; never becomes ready.Starting witness...→Witness witness : BBDzeCI8m9Ls3OBw_LTOnJSEUyWXMD-Xggp4ufqeAE_9, andGET /oobi/<AID>/controller→ 200.Verified end-to-end through the
witness-qualifierblack-box acceptance harness (full C1–C19 + Tier-P bar).Found while evaluating the keri 1.3 line as a deployable witness closure — it was the only thing blocking it.