Commit 656e3e7
committed
fix(mcp-profile-router/e2e): bypass Envoy egress for backend calls to avoid SO_REUSEPORT deadlock
On Linux, SO_REUSEPORT assigns incoming TCP connections to a specific
Envoy worker socket via kernel hash. When callServer() runs inside the
filter body callback, the Envoy worker thread is blocked in CGO; if the
outgoing connection hashes to that same worker's socket, Envoy can never
accept it and the 2-second http.Client.Timeout fires, leaving no session
ID in the response.
On macOS SO_REUSEPORT is force-disabled so a shared accept socket lets
any free worker pick up the connection — hence tests pass locally.
Fix: point profile Server.URL directly at the httptest backends instead
of routing through the Envoy proxy/egress listener. All profile-router
logic (auth, aggregation, tool routing, session encoding) is still fully
exercised. The cluster-router debug endpoint check in the combo test is
unaffected as it is a simple GET from the test goroutine.1 parent e36de7e commit 656e3e7
1 file changed
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
200 | 204 | | |
201 | 205 | | |
202 | 206 | | |
203 | 207 | | |
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
207 | | - | |
208 | | - | |
| 211 | + | |
| 212 | + | |
209 | 213 | | |
210 | 214 | | |
211 | 215 | | |
| |||
303 | 307 | | |
304 | 308 | | |
305 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
306 | 315 | | |
307 | 316 | | |
308 | 317 | | |
309 | 318 | | |
310 | 319 | | |
311 | 320 | | |
312 | | - | |
313 | | - | |
| 321 | + | |
| 322 | + | |
314 | 323 | | |
315 | 324 | | |
316 | 325 | | |
| |||
0 commit comments