Repository navigation
perf(resolve): query base and override secret stores concurrently - #53
Closed
harrisoncramer wants to merge 1 commit into
Closed
harrisoncramer wants to merge 1 commit into
harrisoncramer wants to merge 1 commit into
Conversation
Owner
Author
|
AI-GENERATED: Closing. Benchmarked stacked on the warm-session change: concurrent base+override is ~2s slower, not faster. op has no real internal parallelism and interleaving two vaults thrashes its per-vault session cache, so the serial base-then-override layering (which groups calls by vault) wins. |
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.
When a project layers a secret override over a base store, each app resolves its secrets from both, and today the layered resolver does them one after the other: it fully resolves the base, then resolves the override, then merges. Each of those is an independent round-trip to a store, so for two 1Password vaults an app pays base latency plus override latency in series even though neither depends on the other.
This runs the two queries concurrently and joins the results, so an app pays the slower of the two rather than the sum. The merge semantics are unchanged: an override value still wins over the base, a base failure is still fatal, and an override that reports ErrSecretNotFound still means it does not cover this app and falls through to the base. That last case is handled inside the override goroutine so it neither fails the group nor cancels the base query that is still in flight.
Note on ordering: on its own against main this is a structural change with little wall-clock effect, because the 1Password resolver currently serializes every op invocation behind a global mutex, so the two concurrent queries still run one at a time. It pays off once that serialization is lifted (the warm-session-then-parallel change on the other branch), at which point base and override overlap and per-app resolution drops from base+override to max(base, override). Kept on a separate branch off main so the two approaches can be compared independently.