| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Always close an opened schema read handle after the read attempt, retaining the original read failure if cleanup also fails. Main Issue: apache#26815 Assisted-by: OpenAI Codex
Unwrap asynchronous errors before attaching suppressed close failures. Exercise delayed read and close callbacks, malformed schema entries, failed opens, and synchronous exceptions. Assisted-by: OpenAI Codex
| Back | FazBrowse Home | New Git URL |
Main Issue: #26815
Motivation
Schema storage closes an opened BookKeeper read handle only when the entry read succeeds. A failed read bypasses cleanup and can leave the handle and its metadata listener retained.
Modifications
Failed reads remain failed; this change does not introduce retries or modify BookKeeper watch registration.
Verifying this change
Local validation passed as described below. Full CI validation is still pending.
BookkeeperSchemaStorageReadHandleTest covers nine outcomes through the public storage read path. Tests delay read/close callbacks to check ordering, use malformed serialized bytes for decoding failures, assert exactly one close after a successful open, and verify both the primary and suppressed errors. The failed-open control verifies that no read or close is attempted.
With the tests unchanged and only the production changes removed (base 1046481c970067cbca9c80a25a98257b9179a3da), four cases fail: three read-failure paths never invoke close, and a combined decode/close failure loses the decode error. The other five are compatibility controls that pass on both versions.
The two combined-failure cases also fail against the initial PR implementation: the close error was attached to an asynchronous wrapper and was lost when the caller unwrapped the original error. The updated implementation preserves it on the underlying cause.
With the fix restored, all nine cases and 19 related existing tests pass (28 total), along with quickCheck:
Does this pull request potentially affect one of the following parts: