Skip to content

fix: make local registry concurrent delete parent cleanup race-safe#376

Merged
JeremyWurbs merged 1 commit intodevfrom
fix/issue-375
Feb 25, 2026
Merged

fix: make local registry concurrent delete parent cleanup race-safe#376
JeremyWurbs merged 1 commit intodevfrom
fix/issue-375

Conversation

@AgentDosaku
Copy link
Collaborator

@AgentDosaku AgentDosaku commented Feb 25, 2026

Summary

Fixes a race condition in local registry delete cleanup where parent.iterdir() could raise FileNotFoundError if another concurrent delete removed the parent directory between checks.

Changes

  • Updated LocalRegistryBackend.delete() parent-directory cleanup to be race-safe.
  • Treat FileNotFoundError during parent cleanup as benign (already cleaned by another worker).
  • Added focused unit test covering this race path.

Testing

  • uv run pytest tests/unit/mindtrace/registry/backends/test_local_registry_backend.py -k "delete_parent_cleanup_race_on_iterdir or delete_parent_directory_error"
  • uv run pytest tests/integration/mindtrace/registry/core/test_all_supported_backends.py -k "test_concurrent_delete_operations and local"

Fixes #375

Handle FileNotFoundError when parent directory is removed concurrently during delete cleanup. Adds a focused unit test for the race path.
@JeremyWurbs JeremyWurbs merged commit 50d7de3 into dev Feb 25, 2026
4 checks passed
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.

Race condition in local registry concurrent delete (FileNotFoundError in integration test)

3 participants