Repository navigation
Keep the original errno in atomic-write and lock errors - #84
Merged
Merged
Conversation
The parity probe reported only the Zig error name when an atomic write failed, and it never acquired a state lock. A wrong path or a dropped OSError text could not be seen from Python. Print the full atomic-write diagnostic, and the state lock's text and path. The test raises open, write, rename, missing-parent, permission, lock file and POSIX sidecar failures, and compares that text with the OSError Python raises for the same call. Cleanup restores a mode-0555 directory before removing it, and a write-fsize skip no longer requires the process to run as root.
A failed stat or unlink of the temporary file runs after the OSError text has been built. That cleanup used to replace sys.last_errno, so a later describe saw the cleanup error instead of the original one. atomicWriteAt's cleanup unlink keeps it the same way. Tests make that cleanup fail with a different errno and require the original to remain.
osFailure returns slices of thread-local storage and had no doc comment, so the generated API page did not say that the next acquire on the same thread reuses them.
F_SETLKW treated EAGAIN and EACCES as Unexpected. describe of that error ignores EACCES and prints an I/O error, while the snapshot kept permission denied. Return the mapped error so the two agree: EAGAIN stays Unexpected and EACCES is AccessDenied.
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.
Follow-up to #75, which merged with three problems in its error reporting.
F_SETLKW) treatedEAGAINandEACCESas unexpected, sodescribeprinted an I/O error while the snapshot said permission denied. It now returns the mapped error:EAGAINstays unexpected andEACCESbecomesAccessDenied.sys.last_errnoafter the OSError text was built, so a laterdescribereported the cleanup error. The original errno is now kept, inatomicWriteAtas well. Tests make the cleanup fail with a different errno and check that the original survives.osFailurereturns slices of thread-local storage. Its new doc comment says the next acquire on the same thread reuses them.The parity probe now prints the full atomic-write diagnostic and the state lock's text and path. The Python test triggers open, write, rename, missing-parent, permission, lock-file and POSIX sidecar failures and compares the text with the OSError Python raises for the same call.