Repository navigation
[Serve] Route HAProxy ingress through request routers - #66592
Conversation
Signed-off-by: Seiji Eicher <[email protected]>
1acc240 to
a038e7f
Compare
Signed-off-by: Seiji Eicher <[email protected]>
a038e7f to
27723f4
Compare
There was a problem hiding this comment.
Code Review
This pull request updates the HAProxy ingress request router to support routing for all HTTP methods instead of only POST requests. It replaces the specific session and request ID forwarding logic with a general mechanism that forwards client request headers (excluding hop-by-hop headers) and the multiplexed model ID to the internal router. The feedback points out a potential runtime error in the Lua script where calling :lower() on a nil token match (which can occur if a token contains a newline) could cause a crash, and suggests safely verifying the match before transforming it.
|
@eicherseiji can it have any impact on the latencies? if yes, can we run the staging load test on it once? |
|
The hot path is POST, which already goes through |
Signed-off-by: Seiji Eicher <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3627426. Configure here.
| for _, value in pairs(connection) do | ||
| for token in value:gmatch("[^,]+") do | ||
| excluded[token:match("^%s*(.-)%s*$$"):lower()] = true | ||
| end |
There was a problem hiding this comment.
Header iteration may crash routing
High Severity
request_headers_for_router walks HAProxy req_get_headers() value tables with pairs and calls string methods on every entry. Those tables are 0-indexed and historically include a numeric used count. A normal Connection header would then throw in the Lua action and fail routing for typical HTTP/1.1 traffic.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3627426. Configure here.


Summary
Make HAProxy consult an application's ingress request router for every HTTP request, independent of method. Forward end-to-end request headers while filtering hop-by-hop/framing fields, and pin the returned replica.
Request-body forwarding remains separately opt-in for body-aware routers.
Tests
Duplicate search
No open duplicate found.
AI assistance
AI assistance was used; the changes require submitter review before this draft is marked ready.