You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "ggbdpq (via GitHub)" <gi...@apache.org> on 2026/09/01 15:50:55 UTC
[PR] test(eval): bound fragmented-handshake recv by the handshake deadline [maka]
ggbdpq opened a new pull request, #4488:
URL: https://github.com/apache/maka/pull/4488
## Summary
The live Eval egress proxy test failed intermittently with `TimeoutError: timed out` from `sock.recv` inside `finish_memory_bio_handshake` (subtest `first_fragment_size=2`, CI run 33291789451) while the other six live cases passed. The triggering PR touched neither Eval nor the proxy.
Two conflicting clocks were in play: the caller configured the socket with `settimeout(10)` and passed `timeout_s=20` as the handshake deadline. Under CI load a single server segment can take longer than the per-recv 10s while the 20s handshake contract still has budget, so one slow recv aborted a handshake that would have completed. More fragments means more recv rounds, and each round rolled a fresh independent 10s dice — which is why the flake was intermittent and subtest-specific.
This change binds each recv to the remaining handshake deadline: wait at most `deadline - now`, restore the caller's configured timeout afterwards. The overall contract stays 20s — no retry is added, no deadline is weakened; the per-operation clock simply stops contradicting the deadline it exists to serve.
Fixes #4240
## Verification
| Check | Command | Result |
|---|---|---|
| Handshake driver unit tests | `python -m unittest test_egress_filter_live -v` (packages/eval/harbor) | 8 tests: both `MemoryBioHandshakeDriverTest` cases pass — the existing flight-flush contract on the updated `FakeSocket`, plus the new deadline-bounding case; the six live cases skip without `MAKA_EVAL_EGRESS_PROXY_TEST=1` |
| New contract test | `test_recv_waits_until_the_deadline_not_an_independent_socket_clock` | pins that every recv waits at most the remaining deadline (positive, ≤ `timeout_s`, non-increasing across rounds) and the caller's 10s timeout is restored after each recv |
| Format | `npm run format:check` | Checked 1780 files, no fixes applied |
| ASF headers | `npm run check:asf-headers` | Every source file carries the ASF header |
Not run locally: the live mitmproxy suite (`test:egress-proxy:live`) requires the Docker build and is gated behind `MAKA_EVAL_EGRESS_PROXY_TEST=1`; CI runs it in its Linux container. The change is platform-neutral Python (stdlib `socket`/`time` only) and the live path's diff is the recv-bounding helper alone.
## AI use
Select exactly one:
- [ ] No generative tool made a substantive contribution
- [x] Generative tooling made a substantive contribution
Tool(s) and scope: GLM-5.3-Flash via ZCode — diagnosed the two-clock contract conflict from the CI trace, implemented the deadline-bounded recv and the contract-pinning unit test, and ran the verification table above. The commit carries a `Generated-by` trailer.
## Checklist
- [x] Tests cover the change and fail without it
- [x] Lint, format, typecheck and the affected suites pass locally
Does this PR entail a change in behavior?
- [x] Yes — test-only: a single slow segment now consumes remaining handshake budget instead of failing at an independent 10s per-recv timeout; production code is untouched
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] test(eval): bound fragmented-handshake recv by the handshake deadline [maka]
Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener merged PR #4488:
URL: https://github.com/apache/maka/pull/4488
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org