| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Release the read-only handle cache on close, including fenced closes and handles whose opens are pending, without changing writable managed-ledger shutdown. Main Issue: apache#26815 Assisted-by: OpenAI Codex
Guard cache insertion against concurrent close and cover reads after normal or fenced close, repeated close, and independent cleanup failures. Assisted-by: OpenAI Codex
| Back | FazBrowse Home | New Git URL |
Main Issue: #26815
Motivation
A read-only managed ledger has no current write handle. Its close path therefore skips the write-handle callback that normally releases cached read handles, leaving their metadata listeners registered. A read submitted after close can also open another handle and repopulate the cache.
Modifications
Writable managed-ledger behavior is unchanged. Temporary initialization-handle cleanup is covered independently by #26817. This change initiates cached-handle cleanup; it does not make the managed-ledger close callback wait for every pending BookKeeper open/close.
Verifying this change
Local validation passed as described below. Full CI validation is still pending.
ReadOnlyManagedLedgerHandleCloseTest covers six cases: normal/fenced cleanup, a pending open completing after close, rejection of reads after normal/fenced close, and cleanup of multiple cached handles when one close fails. It also verifies an empty cache, exactly-once cleanup on repeated close, and no new BookKeeper open after close. Assertions run before fixture cleanup.
With the tests unchanged and only the production changes removed (base 1046481c970067cbca9c80a25a98257b9179a3da), all six cases fail: handles are not closed, the pending-open cache entry remains, or reads still succeed after close.
With the fix restored, all six cases and ten existing read-only tests pass (16 total), along with quickCheck:
Does this pull request potentially affect one of the following parts: