fix(registry): fix JIT error scoping race#2199
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
/assign @aishukamal |
|
@LukeAVanDrie: GitHub didn't allow me to assign the following users: aishukamal. Note that only kubernetes-sigs members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahg-g, LukeAVanDrie The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Concurrent requests waiting on JIT provisioning could bypass error checks if the primary request failed. Store init error on struct to ensure all waiters see the failure.
|
/lgtm |
…i-inference-extension#2199) * fix(registry): fix JIT error scoping race Concurrent requests waiting on JIT provisioning could bypass error checks if the primary request failed. Store init error on struct to ensure all waiters see the failure. * rebase and resolve conflicts
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR fixes a race condition where concurrent requests waiting for JIT provisioning could incorrectly proceed with an uninitialized flow if the primary requester failed.
The Bug:
WithConnectionand startsfr.ensureFlowInfrastructure.state.initialized.Do.jitErr(local var) is set.WithConnectionreturns error.state.initialized.Doreturns (no-op).jitErr, which isnilbecause the error was scoped to Request A's stack.The Fix:
initErrfield toflowState.fr.ensureFlowInfrastructureis now stored on the struct itself.state.initErrafter theDoblock returns.Testing:
TestFlowRegistry_JITErrorScopingwhich deliberately stalls concurrent requests during JIT provisioning and forces a failure.Which issue(s) this PR fixes:
Followup to @aishukamal's comment here. Thanks for catching this!
Does this PR introduce a user-facing change?: