-
Notifications
You must be signed in to change notification settings - Fork 53
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
Simplifying EPP-side buffer #538
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kfswain 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 |
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
9777fbe
to
709ef28
Compare
/lgtm This makes sense to me |
/retest |
Since the EPP can control the flow of ext-proc messages by calling srv.Recv(), and we need to buffer the body messages anyway, io.Pipe is an over complication and we can simply use a byte array.
Additional Notes:
io.Pipe used in this way can cause a race condition: if multiple go routines are created with writers in quick succession, there is a case where the thread scheduler will select a routine that has a writer out of order, and cause the corresponding reads to happen out of order, causing a bad json parse and a failure of the message read.
A following PR is going to parse the
content-length
header and set the byte slice to that length to further optimize and prevent unneeded reallocation of the underlying array.