Repository navigation
fix(container): preserve LRU links and insertion state - #284
Merged
Merged
Conversation
nick2781
marked this pull request as ready for review
November 4, 2026 02:47
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 4, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 4, 2026
Prepare empty containers before rebuilding values and independent recency links. Keep full insertion allocation injection and sweep copy content allocations from the first source lookup, including allocating value copies and throwing keys. Add allocation-free terminate diagnostics and document the unrecoverable MSVC Debug noexcept proxy-construction boundary in both languages.
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 4, 2026
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.
Copied LRU caches retained recency iterators into the source cache, causing freed-memory access after the source was cleared or destroyed. Prepare empty containers first, rebuild each copied entry and its own recency links, and finish preparing copy assignment before replacing the destination.
Insertion now rolls back partial value/list/index changes when allocation or key copying fails, preserving capacity and eviction order. Existing APIs, class fields and borrowed-pointer semantics remain unchanged; rebuild header consumers. Bilingual guidance and permanent C++ tests are included.
The Windows failure exposed MSVC Debug bookkeeping allocation within a standard-library
noexceptconstructor. Copy tests now arm failure at the first source lookup after empty-container setup, before any entry is copied. This retains all content-allocation failures, allocating value/key copies, owner release, recovery and independent eviction; full insertion allocation injection also remains. It does not promise recovery from allocation inside standard-librarynoexceptinfrastructure. Iterator debugging, build configuration and sanitizer coverage are unchanged.The public MySQL lifetime regression also treated successful BEGIN as proof of a still-active transaction ID. Preserve its original 40 ms deadline and cleanup budget, check business success and transaction status separately, and gate unfinished rollback before asserting that shutdown must wait. Deterministic peer-based regressions cover expiry before owner delivery and expiry after a handle is delivered. Production transaction behavior and timeouts are unchanged; bilingual examples now check ID and active status.
Validation: regressions reproduce the source-iterator use-after-free and failed-insert capacity violation on the original main. The repaired
check-lru-mappasses 6 cases / 120 assertions plus 3 cases / 264 assertions in macOS Debug, and the same checks with AddressSanitizer plus UndefinedBehaviorSanitizer. The relevant public MySQL target passes 7 cases / 656 assertions and its DSO control. Complete clang-format 18 and Nimbus/HTML/Markdown/AI-export checks pass. The preceding candidate passed all three Windows jobs; refreshed protected acceptance remains required for this final head.