Skip to content

Honor configured timeout for synchronous API requests - #3995

Open
SiavashShams wants to merge 2 commits into
EleutherAI:mainfrom
SiavashShams:oss/api-sync-timeout-ignored-20260813-0100050700
Open

Honor configured timeout for synchronous API requests#3995
SiavashShams wants to merge 2 commits into
EleutherAI:mainfrom
SiavashShams:oss/api-sync-timeout-ignored-20260813-0100050700

Conversation

@SiavashShams

Copy link
Copy Markdown
Contributor

Problem

TemplateAPI stores its configured timeout, but the synchronous requests.post call did not use it. Since synchronous requests are the default, an unresponsive endpoint could block without honoring the configured timeout.

Change

Pass self.timeout to the synchronous request and add a regression test using a non-default timeout of 17 seconds.

Tests

  • python -m pytest tests/models/test_api.py -k timeout -q: 1 passed; the regression test failed on the base commit with KeyError: 'timeout'.
  • python -m pytest tests/models/test_api.py -q: 15 passed.
  • pre-commit run --files lm_eval/models/api_models.py tests/models/test_api.py: reported existing whole-file lint violations outside the changed lines. A non-mutating Ruff comparison found 134 base diagnostics and 133 patched diagnostics in api_models.py, removing the request-without-timeout diagnostic, and 4 diagnostics in test_api.py both before and after.
  • pytest -x --showlocals -s -vv -n=auto --ignore=tests/models/test_openvino.py --ignore=tests/models/test_hf_steered.py --ignore=tests/scripts/test_zeno_visualize.py: not completed because OpenMP could not create sandboxed /tmp shared files and the xdist workers stalled before running tests.

@SiavashShams
SiavashShams force-pushed the oss/api-sync-timeout-ignored-20260813-0100050700 branch from 1c5efa7 to a1c97dd Compare August 13, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant