Skip to content

fix(io): break object store registry ownership cycle - #11365

Merged
Xuanwo merged 3 commits into
mainfrom
xuanwo/fix-lance-registry-ownership
Nov 23, 2026
Merged

Xuanwo merged 3 commits into
mainfrom
xuanwo/fix-lance-registry-ownership

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

ObjectStoreRegistry keeps the scoped storage-options accessor alive in both its active_stores and building maps. For a provider-backed accessor (namespace create), that accessor owns the namespace client and its session, which owns the same registry, so dropping the table and connection cannot release either. Weak store values and periodic pruning do not break the cycle. This blocks the valid empty nested-namespace create in lancedb/lancedb-c#151 (79f8f56, tests/test_table.cpp:604).

Both maps now share a private key that stores the already resolved scoped accessor_id() instead of the accessor Arc; the full params still drive construction and refresh. Cache identity for the base/provider/wrapper, metrics prefix, scheduler mode and validation, and singleflight/retry behavior are unchanged.

The added regression uses the local file provider and an options provider that holds the same registry. It fails on f9fd19e with the object store cache retained the storage options provider and passes with this change.

Verification

On sophon-blob, exact f2d3971:

cargo test -p lance-io --lib --profile ci test_cache_does_not_retain_storage_options_provider -- --nocapture

1 passed; 0 failed

The same test binary ran object_store::providers::tests: 21 passed, 0 failed, including the base-scoped options, cache statistics, pruning, and singleflight/retry tests.

The same regression on parent f9fd19e fails with the retention assertion. cargo fmt --all -- --check, git diff --check, and cargo metadata --locked --no-deps passed.

Hosted Clippy, rustdoc, MSRV, Linux, macOS, Windows, Python, Java, and compatibility checks passed on f2d3971. The dependency check fails on RUSTSEC-2026-0592 in the url 2.5.8 already locked on main. The same check reports the libsais-rs 0.2.2 yank as a warning. #11370 updates the root lock to the patched release.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@github-actions github-actions Bot added A-encoding Encoding, IO, file reader/writer bug Something isn't working labels Nov 22, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

Removing accessor ownership from both registry maps breaks the cycle while preserving scoped cache identity and construction parameters. The regression fails with the previous implementation and passes here; all 21 registry tests pass.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. and removed K-approved Latest Gatekeeper recommendation permits acceptance. labels Nov 22, 2026
@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. and removed K-approved Latest Gatekeeper recommendation permits acceptance. labels Nov 22, 2026
Xuanwo added a commit that referenced this pull request Nov 22, 2026
`Cargo.lock` on `main` locks `url` 2.5.8, which RUSTSEC-2026-0592 marks
as vulnerable: `Url::origin()` recurses once per nested `blob:` prefix,
so a crafted URL overflows the stack and aborts the process. The
advisory lists 2.5.9 as the first patched release.

This is the cargo-deny failure currently blocking #11365. On its exact
head `f2d3971dcfb0ef170a6aca634aeafb413ffc7b58`, hosted job
[137205006261](https://github.com/lance-format/lance/actions/runs/45021433506/job/137205006261)
fails with:

```text
error[vulnerability]: Stack overflow in `Url::origin()` on nested `blob:` URLs
    ┌─ /github/workspace/Cargo.lock:792:1
...
    ├ ID: RUSTSEC-2026-0592
    ├ Solution: Upgrade to >=2.5.9 (try `cargo update -p url`)
```

This changes only the lockfile. `url` moves from 2.5.8 to 2.5.9, and
`form_urlencoded` from 1.2.2 to 1.2.3, the version `url` 2.5.9 requires
(`^1.2.3`). `url` is transitive here and every dependent accepts a
compatible range, so `Cargo.toml`, the feature set and the 1.95
toolchain are unchanged. No advisory ignore is added.

Validation at this head:
- `cargo metadata --locked` and `cargo +1.95.0 metadata --locked
--no-deps` pass.
- `cargo tree -i [email protected] --locked` resolves one `url` 2.5.9.
- `cargo deny check advisories` passes; the only output is the
pre-existing warning for yanked `libsais-rs` 0.2.2, which this change
does not touch.
- `git diff --check` passes; the diff is 4 insertions and 4 deletions,
limited to the two lockfile entries.
- The published crate checksums match the lockfile: `url` 2.5.9
`f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a`,
`form_urlencoded` 1.2.3
`afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e`.
@Xuanwo
Xuanwo merged commit 11c0550 into main Nov 23, 2026
40 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/fix-lance-registry-ownership branch November 23, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-encoding Encoding, IO, file reader/writer bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants