Repository navigation
fix: mk_dirs_if_missing leaves no stray directory for a key a layer below rejects (#122) - #128
Merged
Merged
Conversation
…e then fails (#122) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Fixes #122.
mk_dirs_if_missing(filt_iter(Files, filt=...)): the preset made the directory before the innerfilt_iterrefused the key. Layers cannot be asked in advance (see #129/#130 for a probe), so the decorator now wraps__setitem__itself: it makes the missing directories (recording only those this call made), writes, and if the write raises removes them again, deepest first, only if still empty. Other directories, and anything another writer put there, are untouched.mk_dirs_if_missing_presetis kept unchanged (public) but the decorator no longer uses it.Adversarial review (Opus): no defect in any stacking (class/instance, either side of filt_iter/wrap_kvs/KeyCodecs, doubled, graze/astern suites); found a race where a directory created meanwhile by another process was counted as made here: fixed (level-by-level mkdir, tracked only on success) with a test. Residual, documented: a concurrent writer that had just seen the new directory exist can lose it to the cleanup (its write fails like any write to a missing directory).
Dependents gate (101 suites,
timeout 2400 priv test-dependents dolwith this branch on PYTHONPATH vs master): identical failing set (25 environmental/pre-existing: missing wkhtmltopdf, couchdb, collection errors...). mergeset passed 320 vs 331 with the same 2 failures (its tree changed between the runs). /dev/null intact.🤖 Generated with Claude Code