Skip shell completions provisioning on cache miss#5878
Open
inancgumus wants to merge 4 commits intobump-k6provider-v0.4.0from
Open
Skip shell completions provisioning on cache miss#5878inancgumus wants to merge 4 commits intobump-k6provider-v0.4.0from
inancgumus wants to merge 4 commits intobump-k6provider-v0.4.0from
Conversation
c492123 to
5eb55bf
Compare
5eb55bf to
3387b0e
Compare
3387b0e to
ee08516
Compare
ee08516 to
eb75aad
Compare
Both interfaces read the context from gs.Ctx. Passing it explicitly makes the timeout boundary visible at call sites and avoids mutating shared state to propagate deadlines.
Completion delegation needs to skip when the binary isn't cached, otherwise the shell hangs 10-30s on a build. Adding a cachedOnly field to buildProvisioner switches GetBinary to GetCachedBinary, which returns fs.ErrNotExist on miss so callers bail out instantly.
Shell completions for extensions called buildExtensionDeps which triggered full provisioning. completeExtension uses a cacheProvisioner with a 3s timeout so completions return nothing on cache miss instead of hanging on a build-service round trip.
The completion path called buildExtensionDeps which triggered full provisioning. Switching to completeExtension with cacheProvisioner makes completions bail out on cache miss instead of blocking on a build.
eb75aad to
2b05c01
Compare
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.
What?
Skips completions for uncached provisioned extensions. The cache-only provisioner skips the build on cache miss and times out on service slowness. Once
k6providermoves to fully offline lookups, this code will pick up that improvement without any changes in k6.Why?
Completions for uncached extensions may hang users without feedback because of provisioning.
Related PR(s)/Issue(s)