Write document files synchronously by default - #30
Open
danielebarbaro wants to merge 1 commit into
Open
danielebarbaro wants to merge 1 commit into
danielebarbaro wants to merge 1 commit into
Conversation
Contributor
Benchmark Comparison
xs
small
|
Collaborator
Author
|
The flagged row is a 2 MB shift between phases, not extra memory. In the #29 and #30 show exactly the same pattern while touching unrelated code, and neither changes the |
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.
Closes #26.
addDocument()forked a child for every document wheneverext-pcntlwas loaded. The child ended withexit(0), running the parent's shutdown functions and destructors, and children were reaped only insave().Changes
asyncWritesparameter (defaultfalse) on theVectorDatabaseconstructor andopen()opts back in.posix_kill(getmypid(), SIGKILL), so inherited shutdown functions and destructors never run. Async therefore needsext-pcntlandext-posix, and falls back to sync writes otherwise.WNOHANGon every async write.RuntimeExceptionif not. Before, a failed write went unnoticed and an exception in the child unwound into the caller's code.Tests
tests/Persistence/DocumentStoreTest.php, including a subprocess test that registers a shutdown function and a destructor and asserts only the parent PID runs them. The same script against the previousDocumentStorelogs both from the child PID too.Notes
asyncWrites: true.[Unreleased]CHANGELOG section will conflict trivially with Add compact() to reclaim soft-deleted nodes #29, whichever merges second.