Skip to content

Conversation

@rahulgurnani
Copy link
Contributor

@rahulgurnani rahulgurnani commented Nov 18, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:
This PR makes execution of prepare data plugins in the order of dependencies. Dependency cycles are also validated at the startup. Failure of any prepare data plugin results is returned. Presently these plugins are fail open i.e. any failure in this step is logged but the request execution continues.

Which issue(s) this PR fixes:

Fixes #1743

Does this PR introduce a user-facing change?:

NONE


@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Nov 18, 2025
@netlify
Copy link

netlify bot commented Nov 18, 2025

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

Name Link
🔨 Latest commit db79ebf
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/691f919cf1e9470008a97178
😎 Deploy Preview https://deploy-preview-1878--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 project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 18, 2025
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 18, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @rahulgurnani. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 18, 2025
@rahulgurnani rahulgurnani marked this pull request as ready for review November 18, 2025 23:19
@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 Nov 18, 2025
@rahulgurnani
Copy link
Contributor Author

/assign @kfswain

@capri-xiyue
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 19, 2025
@nirrozenbaum
Copy link
Contributor

have we validated the added value of running in parallel versus sequentially in terms of time/performance measurements?

obviously running in parallel is faster but it’s also more complex to write, review and maintain the code.

if we make our codebase more complex (which is fine in many cases!), I suggest we validate the added value and make a data driven decision.
(e.g., what if I tell you that running in parallel performs better in 0.003 ms, would we still want it?)

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rahulgurnani
Once this PR has been reviewed and has the lgtm label, please ask for approval from kfswain. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@rahulgurnani
Copy link
Contributor Author

rahulgurnani commented Nov 19, 2025

have we validated the added value of running in parallel versus sequentially in terms of time/performance measurements?

obviously running in parallel is faster but it’s also more complex to write, review and maintain the code.

if we make our codebase more complex (which is fine in many cases!), I suggest we validate the added value and make a data driven decision. (e.g., what if I tell you that running in parallel performs better in 0.003 ms, would we still want it?)

I agree we need to benchmark/scale test to see the value add, I plan to scale test when I am migrating prefix cache and predictor plugins. I can make it sequential in this PR if that sounds better. Let me know.
I can bring in these changes in a future PR. Thanks!

@nirrozenbaum
Copy link
Contributor

I can make it sequential in this PR if that sounds better. Let me know.
I can bring in these changes in a future PR. Thanks!

yeah, IMO we should start simple (in general, that's always my preferred approach).
that's is - no sync mechanism, no waiting group or mutex. just a DAG calculation at startup and then running plugins sequentially with BFS or something like that for an incoming request.
before adding code complexity, we should validate that the complexity brings value.

@kfswain please chime in if you think differently.

@rahulgurnani rahulgurnani changed the title Execute prepare data plugins concurrently as a DAG Execute prepare data plugins in topological order of data dependencies Nov 20, 2025
@rahulgurnani
Copy link
Contributor Author

I can make it sequential in this PR if that sounds better. Let me know.
I can bring in these changes in a future PR. Thanks!

yeah, IMO we should start simple (in general, that's always my preferred approach). that's is - no sync mechanism, no waiting group or mutex. just a DAG calculation at startup and then running plugins sequentially with BFS or something like that for an incoming request. before adding code complexity, we should validate that the complexity brings value.

@kfswain please chime in if you think differently.

Updated the PR based on the suggestion. I did a topological sort because that would be the order in which we would want the plugins to execute. Also updated tests. PTAL. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for PrepareRequestData and AdmitRequest plugins

5 participants