Repository navigation
SWF(bug): reject huge request timeouts without panicking - #16
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
PR #16 GPU validation: PASSPR head: Build: Live timeout=1e30 and 1e19 return HTTP 400/OpenAI errors on chat and legacy completions, blocking and streaming; valid timeout=10 still generates. CUDA timeout tests cover duration/instant overflow, finite/NaN helper validation and ordinary budgets. No main overflow reproduction: that would deliberately panic its request path. Score endpoint/server-timeout misconfiguration not exercised live. PR regression tests (CUDA build)PATH=/home/robert/.cargo/bin:$PATH CUDA_HOME=/home/robert/atlas-x86-probe/cuda-home ATLAS_TARGET_HW=rtx5090 ATLAS_TARGET_MODEL=holo-3.1-4b ATLAS_TARGET_QUANT=nvfp4 ATLAS_PREDICTOR_ARCH=sm_120 ATLAS_NO_RDMA=1 CUDARC_CUDA_VERSION=12090 LD_LIBRARY_PATH=/usr/local/cuda-12.9/lib64 cargo test --release -p spark-server --bin spark --no-default-features --features cuda --target-dir /home/robert/repos/atlas-target-sm120 timeoutNo GPU stub script run; full suite/lints not repeated for this validation-only step. Raw HTTP bodies/headers are adjacent chatcurl -sSN --max-time 90 -D /home/robert/repos/gpu-logs/pr16-chat.headers -o /home/robert/repos/gpu-logs/pr16-chat.out -w '%{http_code}' http://127.0.0.1:8897/v1/chat/completions -H 'content-type: application/json' -d '{"model": "holo", "messages": [{"role": "user", "content": "What is the capital of France? One sentence."}], "max_tokens": 256, "temperature": 0, "enable_thinking": false}'HTTP 200 streamcurl -sSN --max-time 90 -D /home/robert/repos/gpu-logs/pr16-stream.headers -o /home/robert/repos/gpu-logs/pr16-stream.out -w '%{http_code}' http://127.0.0.1:8897/v1/completions -H 'content-type: application/json' -d '{"model": "holo", "prompt": "The capital of France is", "max_tokens": 12, "temperature": 0, "stream": true, "stop": ["\n"]}'HTTP 200 responsescurl -sSN --max-time 90 -D /home/robert/repos/gpu-logs/pr16-responses.headers -o /home/robert/repos/gpu-logs/pr16-responses.out -w '%{http_code}' http://127.0.0.1:8897/v1/responses -H 'content-type: application/json' -d '{"model": "holo", "input": "What is the capital of France? One sentence.", "max_output_tokens": 200, "temperature": 0, "reasoning": {"effort": "none"}}'HTTP 200 timeout-1e+30-False-Falsecurl -sSN --max-time 90 -D /home/robert/repos/gpu-logs/pr16-timeout-1e+30-False-False.headers -o /home/robert/repos/gpu-logs/pr16-timeout-1e+30-False-False.out -w '%{http_code}' http://127.0.0.1:8897/v1/completions -H 'content-type: application/json' -d '{"model": "holo", "prompt": "Hello", "max_tokens": 1, "timeout": 1e+30, "stream": false}'HTTP 400 timeout-1e+30-False-Truecurl -sSN --max-time 90 -D /home/robert/repos/gpu-logs/pr16-timeout-1e+30-False-True.headers -o /home/robert/repos/gpu-logs/pr16-timeout-1e+30-False-True.out -w '%{http_code}' http://127.0.0.1:8897/v1/chat/completions -H 'content-type: application/json' -d '{"model": "holo", "messages": [{"role": "user", "content": "Hello"}], "max_tokens": 256, "temperature": 0, "enable_thinking": false, "timeout": 1e+30, "stream": false}'HTTP 400 timeout-1e+19-False-Falsecurl -sSN --max-time 90 -D /home/robert/repos/gpu-logs/pr16-timeout-1e+19-False-False.headers -o /home/robert/repos/gpu-logs/pr16-timeout-1e+19-False-False.out -w '%{http_code}' http://127.0.0.1:8897/v1/completions -H 'content-type: application/json' -d '{"model": "holo", "prompt": "Hello", "max_tokens": 1, "timeout": 1e+19, "stream": false}'HTTP 400 timeout-1e+19-False-Truecurl -sSN --max-time 90 -D /home/robert/repos/gpu-logs/pr16-timeout-1e+19-False-True.headers -o /home/robert/repos/gpu-logs/pr16-timeout-1e+19-False-True.out -w '%{http_code}' http://127.0.0.1:8897/v1/chat/completions -H 'content-type: application/json' -d '{"model": "holo", "messages": [{"role": "user", "content": "Hello"}], "max_tokens": 256, "temperature": 0, "enable_thinking": false, "timeout": 1e+19, "stream": false}'HTTP 400 timeout-1e+30-True-Falsecurl -sSN --max-time 90 -D /home/robert/repos/gpu-logs/pr16-timeout-1e+30-True-False.headers -o /home/robert/repos/gpu-logs/pr16-timeout-1e+30-True-False.out -w '%{http_code}' http://127.0.0.1:8897/v1/completions -H 'content-type: application/json' -d '{"model": "holo", "prompt": "Hello", "max_tokens": 1, "timeout": 1e+30, "stream": true}'HTTP 400 timeout-1e+30-True-Truecurl -sSN --max-time 90 -D /home/robert/repos/gpu-logs/pr16-timeout-1e+30-True-True.headers -o /home/robert/repos/gpu-logs/pr16-timeout-1e+30-True-True.out -w '%{http_code}' http://127.0.0.1:8897/v1/chat/completions -H 'content-type: application/json' -d '{"model": "holo", "messages": [{"role": "user", "content": "Hello"}], "max_tokens": 256, "temperature": 0, "enable_thinking": false, "timeout": 1e+30, "stream": true}'HTTP 400 timeout-1e+19-True-Falsecurl -sSN --max-time 90 -D /home/robert/repos/gpu-logs/pr16-timeout-1e+19-True-False.headers -o /home/robert/repos/gpu-logs/pr16-timeout-1e+19-True-False.out -w '%{http_code}' http://127.0.0.1:8897/v1/completions -H 'content-type: application/json' -d '{"model": "holo", "prompt": "Hello", "max_tokens": 1, "timeout": 1e+19, "stream": true}'HTTP 400 timeout-1e+19-True-Truecurl -sSN --max-time 90 -D /home/robert/repos/gpu-logs/pr16-timeout-1e+19-True-True.headers -o /home/robert/repos/gpu-logs/pr16-timeout-1e+19-True-True.out -w '%{http_code}' http://127.0.0.1:8897/v1/chat/completions -H 'content-type: application/json' -d '{"model": "holo", "messages": [{"role": "user", "content": "Hello"}], "max_tokens": 256, "temperature": 0, "enable_thinking": false, "timeout": 1e+19, "stream": true}'HTTP 400 valid-timeoutcurl -sSN --max-time 90 -D /home/robert/repos/gpu-logs/pr16-valid-timeout.headers -o /home/robert/repos/gpu-logs/pr16-valid-timeout.out -w '%{http_code}' http://127.0.0.1:8897/v1/completions -H 'content-type: application/json' -d '{"model": "holo", "prompt": "The capital of France is", "max_tokens": 4, "timeout": 10, "temperature": 0}'HTTP 200 |
46443d5 to
09ec12b
Compare
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
09ec12b to
e200b9a
Compare
Reject unrepresentable request timeouts with HTTP 400 instead of panicking.
Summary
Use fallible duration conversion and checked deadline addition in the shared helper; propagate errors through all callers without disabling deadlines.
Test plan
Failing run, regression tests added before the fix:
Passing run after the fix, same test filter:
The two HTTP-handler regressions deserialize valid JSON (
timeout: 1e30/1e19), exercise chat and legacy completions in both blocking and streaming modes, and assert HTTP 400, an OpenAI error envelope, and no scheduler dispatch. Helper tests retain zero/negative disabling and positive/fractional budgets, and reject NaN/infinity.sparkbinary suite: 3150 passed, 0 failed, 14 ignored.cargo test -p atlas-core --libwith the environment below): 218 passed.ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo doc --workspace --no-deps.bash scripts/ci_gpu_stubs.sh).spark-modelvideo tests failed because this VM's FFmpeg 4.4.2 rejects-fps_mode; confirmed directly with FFmpeg. Server tests are unaffected; no unrelated code changed.Notes for reviewers
Root cause: finite JSON values still exceed Rust's time representations.
1e30fits the wire'sf32but panics inDuration::from_secs_f32;1e19fits a duration but panics in uncheckedInstantaddition. Checking only finiteness or only the conversion misses a panic.try_from_secs_f32pluschecked_addguards both operations at their single source of truth, preserving ordinary budgets and the non-positive-disable contract. The scoring caller also handles an unrepresentable server timeout as a server error before enqueueing work.Try it:
ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo test -p spark-server --bin spark unrepresentable_timeout -- --nocaptureBenchmarks: not applicable; this fixes request validation, not inference performance.
Authorship: AI-authored by Devin.
CLA
Implemented in session Stop huge request timeout panicking deadline helper
Review with Devin · Open in Devin Desktop