Repository navigation
Segment: retain chunk ownership when allocation fails - #138
Open
victorstoica114 wants to merge 1 commit into
Open
victorstoica114 wants to merge 1 commit into
victorstoica114 wants to merge 1 commit into
Conversation
Keep the compacted tail in its existing deque entry, and retain successor chunks in unique_ptr until deque insertion succeeds. Preserve the existing reserve allocation and exception behavior. Add an isolated 31-case CTest regression for compaction and bulk/single append allocation failures, without allocation hooks in the application.
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.
When tail compaction removes and reinserts the last deque entry, deque-node allocation can fail after the original chunk has been freed. Bulk append can also delete an already-owned chunk when successor allocation fails, or leak its successor if deque insertion fails. Single-sample append has the same insertion ownership gap.
Replace the existing tail pointer in place. Hold each successor in
unique_ptruntil its deque entry is inserted, then publish it as the current chunk. The temporary reserve allocation, sample-count behavior and exception propagation are retained. Previously accepted samples remain readable after these failures; this does not add retry-after-failed-append semantics or constructor rollback.The standalone
segment-allocation-testruns only withENABLE_TESTS. Its allocation overrides stay out of PulseView and the existing Boost executable. It covers 31 compaction/bulk/single append cases, including deque boundaries, allocation failure, retained-prefix equality and successor leaks.Validation against upstream
af02198741b4e57c9f9b796bd5e6c0f2ae9f2f2b:This is a focused three-file change based directly on upstream master; it does not depend on #136 or #137. Private captures, the bridge and vendor runtimes are not included.