Skip to content
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

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

kfswain
Copy link
Collaborator

@kfswain kfswain commented Mar 19, 2025

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.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 19, 2025
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 19, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 19, 2025
Copy link

netlify bot commented Mar 19, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit 709ef28
🔍 Latest deploy log https://app.netlify.com/sites/gateway-api-inference-extension/deploys/67db0c5bb3960f00081d2ba7
😎 Deploy Preview https://deploy-preview-538--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kfswain kfswain force-pushed the race-condition-fix branch from 9777fbe to 709ef28 Compare March 19, 2025 18:26
@kfswain kfswain changed the title [WIP] Simplifying EPP-side buffer Simplifying EPP-side buffer Mar 19, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 19, 2025
@ahg-g
Copy link
Contributor

ahg-g commented Mar 19, 2025

/lgtm

This makes sense to me

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 19, 2025
@kfswain
Copy link
Collaborator Author

kfswain commented Mar 19, 2025

/retest

@k8s-ci-robot k8s-ci-robot merged commit a73776c into kubernetes-sigs:main Mar 19, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants