Skip to content

API Reference parrot.knowledge.pageindex.locks

github-actions[bot] edited this page Dec 2, 2026 · 2 revisions

parrot.knowledge.pageindex.locks

View source

Cross-process, per-tree writer lock for PageIndex generation publication (FEAT-831).

Alias JSONTreeStore

Re-exported from parrot.knowledge.pageindex.store.JSONTreeStore.

Class TreeLockTimeout

Raised when the per-tree lock is not acquired within timeout seconds.

Function lock_path

Return <storage_dir>/.locks/<tree_name>.lock after validating tree_name.

lock_path(storage_dir: Path, tree_name: str) -> Path

Parameter Type Default Description
storage_dir Path
tree_name str

Returns: Path

Attribute logger

Function tree_lock

Hold an exclusive lock on tree_name for the duration of the block.

tree_lock(storage_dir: Path, tree_name: str, *, timeout: float) -> AsyncIterator[None]

Parameter Type Default Description
storage_dir Path
tree_name str
timeout float

Returns: AsyncIterator[None]

Raises:

  • TreeLockTimeout — The lock was not acquired within timeout seconds.
  • RuntimeError — fcntl is unavailable on this platform.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally