Skip to content

Storage backends prepare their process-wide lazy state on request - #40

Open
trissim wants to merge 1 commit into
mainfrom
r1e-prepare-storage-backends
Open

trissim wants to merge 1 commit into
mainfrom
r1e-prepare-storage-backends

Conversation

@trissim

@trissim trissim commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

For OpenHCS R1e (no one-time cost after server readiness).

BackendBase.prepare_process() does nothing by default; DiskBackend resolves tifffile's codecs and loads imageio's pillow plugin, which it otherwise does on its first read or write. prepare_storage_backends() builds the backend registry and prepares each backend. An OpenHCS execution server calls it before forking workers, so neither the server nor a worker first-imports these during a timed run (measured there: 60 modules, 0.04 s in the first execution, repeated by each worker).

Tests: 10 PolyStore test files, 174 passed (one new test for the preparation).

Not merged by the author; OpenHCS adopts it after a release.

🤖 Generated with Claude Code

BackendBase.prepare_process() does nothing by default; the disk backend
resolves tifffile's codecs and loads imageio's pillow plugin, which it
otherwise does on the first read or write. prepare_storage_backends()
builds the backend registry and prepares each backend, so an execution
server can pay these one-time costs before it forks workers and reports
ready (OpenHCS R1e: 60 modules and 0.04 s in the first execution, repeated
by every worker).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 16:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants