[Bugfix] Miscalculated load with cache aware routing - #211
[Bugfix] Miscalculated load with cache aware routing#211simondanielsson wants to merge 4 commits into
Conversation
Signed-off-by: simondanielsson <simon.danielsson99@hotmail.com>
|
@BugenZhao Happy to get a review when you have time 🙏 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e68b6c46f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: simondanielsson <simon.danielsson99@hotmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 794d18c571
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: simondanielsson <simon.danielsson99@hotmail.com>
|
@codex review |
|
Failing Trivy CI fixed in : #212 |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Purpose
Caused by double-decrements on request counters, making the load look lower than it is.
Details
The code previously handled increments and decrements manually, which was very error prone because decrements need to happen in many places and conditions.
Solution: Use a RAII guard pattern to automatically decrement on every exit path of
send_typed_request(including early returns).There were at least two instance of double decrementing:
router/src/routers/http/router.rs
Lines 882 to 909 in 5002469
router/src/routers/http/router.rs
Lines 605 to 615 in 5002469
Test Plan
Added new test cases to ensure load is correct in many different cases:
cargo test --lib loadTest Result
Without fixes: 4 fail
With fix:
Essential Elements of an Effective PR Description Checklist