Skip to content

fix(orchestration): close federated-read benchmark socket - #13939

Merged
Jinwoo-H merged 2 commits into
mainfrom
jinwoo/sta-3961-federated-read-benchmark-lifecycle
Aug 12, 2026
Merged

Jinwoo-H merged 2 commits into
mainfrom
jinwoo/sta-3961-federated-read-benchmark-lifecycle

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

The optional federated-read speed test kept one WebSocket open for reuse. If a measured request failed, the test jumped past cleanup and left that socket alive. The benchmark now closes its socket whether measurements pass or fail.

What Changed

  • wrap the retained shared-control benchmark lifetime in try/finally
  • deterministically reject the first measured request after three successful warmups
  • assert connection close, underlying socket close, zero retained handles, normal-success cleanup, and the exact opt-in gate

Why

The benchmark creates and owns the retained connection, so lexical try/finally is the smallest reliable ownership model. This changes benchmark/test code only; production transport behavior is unchanged.

Linked Issue

STA-3961

Follow-up to merged PR #13814.

Visual Proof

N/A — benchmark/test-only resource cleanup with no UI or interaction change.

Testing

  • Focused Vitest suite on macOS: 6 passed, 1 live benchmark skipped by default
  • Baseline oracle: measured rejection produced 0 closes and 1 retained handle
  • Candidate oracle: rejection and success each produced exactly 1 close and 0 retained handles
  • Reverted candidate oracle: returned to 0 closes and 1 retained handle
  • pnpm typecheck
  • pnpm lint (passes; existing warning-level React dependency notices remain outside this diff)
  • CI: 44 checks passed; E2E intentionally skipped because no E2E specs changed

AI Disclosure

Implemented and tested with OpenAI Codex under human-authorized ownership.

Review

Focused self-review and a fresh resource-lifecycle/adversarial review are clean with no actionable in-scope findings. The review strengthened the oracle to inspect the connection's retained socket directly, then repeated the candidate/revert control. Scope is test-only and does not alter production behavior, wire formats, SSH, folder workspace, platform, path, shortcut, mobile, or provider behavior.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (N/A: benchmark-only)
  • pnpm lint, pnpm typecheck, tests, and packaging pass locally or in CI

Author

  • X / Twitter: N/A

@Jinwoo-H
Jinwoo-H marked this pull request as ready for review August 12, 2026 03:51
@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4f1189d5-8164-4548-9f03-49a683e3a5b2

📥 Commits

Reviewing files that changed from the base of the PR and between e597136 and 2cea162.

📒 Files selected for processing (1)
  • src/main/ipc/runtime-environment-federated-read-transport.bench.test.ts

📝 Walkthrough

Walkthrough

The benchmark test now uses Vitest mocks and validates that only '1' enables live benchmarks. Shared-control measurements accept an optional request count and return diagnostics. The measurement always closes the shared connection, including after request failures. Tests cover successful and rejected requests, connection and socket closure, request counts, diagnostics, and retained handles.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: closing the federated-read benchmark socket.
Description check ✅ Passed The description covers the required sections, explains the change and rationale, links an issue, documents testing, and addresses review considerations.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Jinwoo-H
Jinwoo-H merged commit c45c806 into main Aug 12, 2026
45 checks passed
AmethystLiang pushed a commit that referenced this pull request Aug 12, 2026
zpyoung pushed a commit to zpyoung/orca that referenced this pull request Aug 14, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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