← Back to Pull requests

feat(logs): accept per-request stream timeout #13

Closed
unknown closed this pull request without merging on Nov 10, 2026 10:53 UTC
View on GitHub
unknown unknown commented on Nov 09, 2026 16:11 UTC
Author

Log-follow requests accept optional timeout_seconds to control one SSE connection's lifetime. The effective timeout is the smaller of the request and the configured deployment maximum, which defaults to 300 seconds. Omitting the parameter uses that maximum. Expiry sends stream_expired, closes the SDK iterator, and leaves training running so clients can reconnect.

The parameter accepts ASCII integers from 1 to 2147483647 without signs, leading zeros, whitespace, or decimal points. Invalid values return 400 for both follow and snapshot requests; valid values do not affect snapshots. The OpenAPI contract, generated handlers, and user documentation describe this behavior.

The E2E checks now measure one- and three-second stream lifetimes, validate the complete final SSE error, require prompt connection closure, and reconnect for nonempty logs. They confirm the job remains RUNNING after each expiry and that a subsequent snapshot succeeds. Total request deadlines catch stalled headers and quiet or continuously active streams. Measurements are saved in lifecycle evidence. These checks require a real workload supplied with --job-file and --check-stream.

Validation:

  • make check passed: 831 unit tests, lint, formatting, and type checks. CI passed for dc2d722, including generated API and Helm checks.

  • Regression tests reject premature or late expiry, malformed or trailing SSE events, failed reconnection, stopped training, delayed connection closure, ignored deployment caps, and incorrect defaults. Ten false-pass cases failed against the old checker before the assertions were strengthened.

  • Live training lifecycle: 1 passed, 0 skipped in 188 seconds. A 1-second request expired after 0.993 seconds; a reconnected 3-second request expired after 3.000 seconds and delivered nonempty log events. Training remained RUNNING after both expiries, then reached SUCCEEDED. Post-expiry snapshots, Kueue admission, and owned-resource/GPU-pod cleanup passed. Local evidence: artifacts/e2e/pr13-timeout-20261110T103327Z/.
  • Coverage limits: the live deployment predates the deployment-cap fix. Optional --log-stream-max-seconds N tests omitted and above-limit requests against an explicitly configured maximum; its harness regressions pass, but live verification still requires a current image and a short configured limit. The live run did not verify checkpoints or additional algorithm lifecycles. API and gateway CA trust were verified; the separate Kubernetes observer inherited disabled TLS verification from the existing kubeconfig.

    Requested merge order: #13, then #14, then #15.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Log-following requests can set a connection timeout in seconds. The timeout defaults to the configured maximum of 300 seconds and cannot exceed the deployment’s configured limit.
    When a follow stream expires, it closes with a stream_expired event. A valid timeout does not affect snapshot requests.
    Bug Fixes
    Invalid timeout values return a 400 error for both follow and snapshot requests.
    Documentation
    * Updated guidance explains timeout limits, accepted values, and stream expiry.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 428 lines (+321 / -107) across 5 files Reviewer: Sridhar1030 Review duration: 1121m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 428 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.363
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #13"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.1% (MEDIUM) · Higher = larger blast radius
    45.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.8% · Safe to merge
    17.8%