Repository navigation
Conversation
Reload and recheck the canonical file store under one operation-context lease, then atomically publish the staged map. Coordinate login, logout, pending login and legacy mirror writers while preserving main's secure backend and Store API. Build on the OS locking foundation from Vivek1106-04 in related PR databricks#6759; lock_unix.go and lock_windows.go are copied byte-identically. This is a file-backed alternative proposed against main from an owned branch. Co-authored-by: Vivek1106-04 <gangavarapu.0104@gmail.com> Signed-off-by: Harry Yao <harry.yao@databricks.com>
Contributor
|
Thanks for the contribution! This pull request was opened from a fork. If you're a member of the Databricks organization, please request access to the If you're an external contributor, no action is needed; a maintainer will review your pull request. |
Signed-off-by: Harry Yao <harry.yao@databricks.com>
Contributor
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
This branch has not been deployed
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.
Changes
Serialize file-backed OAuth cache refreshes and writers with a stable lease on the canonical effective cache path. Reload and recheck after acquisition, stage the complete map, and publish once after success. Valid-cache reads stay fast; explicit force refresh still exchanges the latest generation. Login, logout, pending device-code state and file mirrors participate without changing the Store interface, dependency versions or main's secure backend.
This is an explicitly attributed file-backed alternative related to #6759. It builds on Vivek1106-04's OS-locking foundation and retains the Unix/Windows adapters byte-for-byte, with the original author credited as co-author. It is proposed from an owned branch against main.
Why
Two processes can share one custom cache file while using different HOME directories. Locking must follow that effective file across atomic replacement, and multi-step updates must remain invisible until successful publication. Rechecking under the lease avoids exchanging a stale refresh token; staging prevents failed updates from exposing provisional entries or overwriting unrelated grants. JSON null entries remain readable as missing entries without breaking healthy entries or later writes.
The coordination guarantee covers participating file-backed writers. Keyring/asynchronous secure operations and older, nonparticipating clients remain outside this change. Release adoption is required before installed clients benefit.
Known follow-up gap — keep this draft: after a provider rotates a refresh token, failed cache publication can leave the old generation available to a fresh client. A subsequent isolated fake-provider diagnostic reproduced that replay. Persistent pre-exchange intent is under design and is not implemented at this head. The local gate results below do not close that failure window.
Tests
Local required test legs passed with Go 1.27.3, FIPS v1.0.0, ordinary timeouts and no automatic reruns:
No package failures. Normal
./task fmt,./task checksand./task lintexit 0;./task doctestpassed on unchanged Python source. Focused storage/U2M has 264 passing leaves, included in the broader root scope rather than added to it.Maintained regressions use real FileStore/OS locks, two processes, separate HOME directories and a shared custom cache file with fake OAuth transport. Controls cover near-expiry refresh, force, cancellation, lock release, writer preservation, rollback, constructor-context compatibility and null entries. Test metadata uses scoped finite fake endpoints; completion/DMS consumers drain output while preserving original goldens and producer failure detection. No assertions, budgets, timeouts or skip conditions were weakened.
Runs used fake HOME/config, read-only dependencies and guarded network access; root's required anonymous public SDK metadata reads retained real TLS responses. Linux keyring acceptance covers the supported unavailable-backend path with unreachable owned D-Bus addresses. Working keyring integration and Windows/macOS runtime behavior remain outside local execution; no live auth, user credential, browser or provider calls were used.
This PR was written with Codex assistance.