-
Notifications
You must be signed in to change notification settings - Fork 150
fix(guard): cache custom serve routes #4059
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
base: 01-28-fix_gateway_configure_cors_for_error_responses
Are you sure you want to change the base?
fix(guard): cache custom serve routes #4059
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: fix(guard): cache custom serve routesSummaryThis PR fixes an issue where custom serve routes were not being cached properly. The key change is modifying the route cache to store RoutingOutput instead of just RouteConfig, allowing both regular routes and custom serve handlers to be cached. Code Quality - Positive Changes
The refactoring in proxy_service.rs:100-136 improves the flow:
This is much cleaner than the previous approach where caching happened after processing. Potential Issues1. TODO Comment Needs Attention (cache/actor.rs:35) The path() method per the documentation at request_context.rs:18 includes both path AND query. This means different query parameters will produce different cache keys. This might be intentional for actor routing OR it might cause unnecessary cache misses if query params do not affect routing. Recommendation: Clarify if query params should be in cache key, then either remove the TODO with an explanatory comment or modify the code to exclude query params. 2. Missing Test Coverage This PR does not include tests for the new caching behavior. Consider adding:
3. Cache Key Documentation (request_context.rs:12-19) The new comments are helpful but could be clearer with examples like "example.com:8080" for host field. Performance ConsiderationsPositive impact:
No concerns:
Security ConcernsNo issues identified. The changes do not introduce security vulnerabilities. Recommendations Summary
Verdict: Approve with Minor SuggestionsThe PR successfully fixes the issue and improves code quality. The core implementation is sound. The main action item is resolving the TODO comment about query parameters in the cache key - this could affect correctness depending on your routing requirements. Before merging:
Great work on the cleaner abstraction! |
03e46b7 to
c9720e1
Compare
3388e0f to
4909921
Compare
4909921 to
ea52472
Compare
c9720e1 to
4e72006
Compare

Fixes RVT-5324