Skip to content

Make AI evaluation judge HTTP timeout cover response body reads - #14134

Merged
wu-sheng merged 2 commits into
apache:masterfrom
songzhendong:fix/ai-eval-http-body-timeout
Oct 14, 2026
Merged

wu-sheng merged 2 commits into
apache:masterfrom
songzhendong:fix/ai-eval-http-body-timeout

Conversation

@songzhendong

Copy link
Copy Markdown
Contributor

What is the purpose of the change?

The OpenAI-compatible AI evaluation judge used HttpRequest.timeout, which stops once response headers arrive. A stalled body could block the judge caller indefinitely.

This change makes request-timeout-seconds in ai-evaluation.yml an end-to-end deadline (TCP connect + waiting for the response + reading the body), consistent with the alarm HTTP hook timeout fix in #14128.

Brief change log

  • Reuse JdkHttpClientUtils.sendStringWithTimeout for the judge HTTP call
  • Wire HttpClient.connectTimeout to the same request-timeout-seconds budget
  • Cap extreme configured timeout values
  • Cover headers/body timeout stages with local peers; assert connect timeout via HttpClient wiring (no external blackhole address)
  • Document the end-to-end semantics in ai-evaluation.md / ai-evaluation.yml

Related issues / PRs

Verifying this change

  • Unit tests in OpenAICompatibleProviderTest (config wiring, connectTimeout, headers/body stages)
  • Internal fork CI green on songzhendong/skywalking-ci (rebase onto latest master)

Documentation

  • docs/en/setup/backend/ai-evaluation.md
  • docs/en/changes/changes.md

Reuse JdkHttpClientUtils for an end-to-end deadline (connect + headers + body),
wire HttpClient.connectTimeout to the same request-timeout-seconds budget, and
cap extreme values. Cover headers/body stages with local peers; assert connect
timeout via HttpClient wiring instead of an external blackhole address.

Co-authored-by: Cursor <cursoragent@cursor.com>
@wu-sheng wu-sheng added this to the 11.1.0 milestone Oct 13, 2026
…ests

- Build the judge HttpClient through a package-private newHttpClient(config),
  so the public constructor delegates instead of repeating every field, and
  test it and getRequestTimeoutSeconds directly instead of reflecting into
  private fields. The cap test now pins the exact cap.
- Comment the request's own timeout, which JdkHttpClientUtils requires, as
  HttpAlarmCallback does, and give the cap its real reason (the JDK client's
  timer arithmetic); JdkHttpClientUtils already saturates the nanos budget.
- Test the stalled body against the existing HttpServer and the production
  constructor. Drop the raw socket peer and the shared-deadline case, which
  JdkHttpClientUtilsTest already covers.
- Docs: the deadline is per HTTP request, and each retry gets its own. Drop
  the changelog entry: AI evaluation has not been released yet.
@wu-sheng wu-sheng added the feature New feature label Oct 14, 2026
@wu-sheng
wu-sheng merged commit 1092e51 into apache:master Oct 14, 2026
473 of 481 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants