-
Notifications
You must be signed in to change notification settings - Fork 176
if request id was not supplied in header, generate uuid #1490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if request id was not supplied in header, generate uuid #1490
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nirrozenbaum The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cc @kfswain |
Signed-off-by: Nir Rozenbaum <[email protected]>
b37aa1c
to
b1230a3
Compare
I notice this deals with the requestID problem, but leave the pluginState concurrent unsafe still. I don't think we have any guarantees that a plugin will provide the appropriate keys when calling |
I'm not sure I followed the problem you're describing.
the sync map is used to map between requestID -> map[string]any (just a [key, value] pairs for that request). a plugin can reuse the same StateKey as many times as we want for different requests. this is not an issue. |
was your intention that the internal map should also be using sync map because we don't trust the caller? |
Yes, if a plugin implemented absentmindedly passes in an empty string for the requestID, that shouldn't crash the entire EPP, and thats an easy one to miss in testing |
yeah, sure. I can change that. |
This PR works for me |
Signed-off-by: Nir Rozenbaum <[email protected]>
Done 💪🏻 |
/lgtm Thanks! |
…igs#1490) * if request id was not supplied in header, generate uuid Signed-off-by: Nir Rozenbaum <[email protected]> * convert map to sync.map in plugin state Signed-off-by: Nir Rozenbaum <[email protected]> --------- Signed-off-by: Nir Rozenbaum <[email protected]>
* if request id was not supplied in header, generate uuid Signed-off-by: Nir Rozenbaum <[email protected]> * convert map to sync.map in plugin state Signed-off-by: Nir Rozenbaum <[email protected]> --------- Signed-off-by: Nir Rozenbaum <[email protected]>
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR fixes a bug of EPP crashing in high scale. the bug happens due to requestID being empty and then prefix plugin maps different requests to the same PluginState entry, which results in different go routines trying to write to the same map concurrently. more details in issue #1489.
This PR guarantees requestID is always set. if it's not supplied as a header, we generate it while handling the request headers, before starting to handle the request body.
Which issue(s) this PR fixes:
Fixes #1489
Does this PR introduce a user-facing change?: