Skip to content

server: own raw WebSocket listener wait - #935

Merged
yisding merged 1 commit into
agent/ws25-safe-await-owned-inputfrom
agent/ws25-voice-server-ws-listener-scope
Aug 7, 2026
Merged

server: own raw WebSocket listener wait#935
yisding merged 1 commit into
agent/ws25-safe-await-owned-inputfrom
agent/ws25-voice-server-ws-listener-scope

Conversation

@yisding

@yisding yisding commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Problem

VoiceServer.stop() passed ws_server.wait_closed() as a bare coroutine to the grandfathered hard-timeout helper. If it resisted cancellation, a later stop invoked wait_closed() again concurrently rather than joining the original surviving cleanup operation.

Changes

  • route the raw-WebSocket listener wait through the existing named listener-cleanup scope
  • retain it in the stage-keyed retry map
  • preserve the historical timeout cancellation request and error text
  • reuse the same waiter on repeated stop attempts
  • add a cancellation-resistant regression proving wait_closed() is invoked once
  • document the shared listener retry ownership

Why / impact

The stop deadline and failure surface stay the same. A timed-out listener waiter now remains attached to VoiceServer, and cleanup retries cannot race duplicate calls against it. This also removes the final bare-coroutine caller of the legacy timeout helper.

Checks

  • .venv/bin/python -m pytest tests/server/test_voice_server_lifecycle.py -q (26 passed, 4 skipped)
  • .venv/bin/python -m pytest tests/server/test_capacity_gate_drain.py tests/server/test_websocket_runtime_drain.py tests/server/test_voice_server_lifecycle.py tests/ratchets/test_source_inventory.py -q (116 passed, 4 skipped)
  • .venv/bin/ruff check src/easycat/server/voice_server.py tests/server/test_voice_server_lifecycle.py
  • .venv/bin/ruff format --check src/easycat/server/voice_server.py tests/server/test_voice_server_lifecycle.py
  • .venv/bin/mypy src/easycat/server/voice_server.py
  • pre-commit hooks

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: eac36d86-8207-49ce-b77d-a28bc97a51d8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@yisding
yisding marked this pull request as ready for review August 7, 2026 02:45
@yisding
yisding force-pushed the agent/ws25-voice-server-ws-listener-scope branch from 6ec0ee4 to 6789dca Compare August 7, 2026 03:16
@yisding
yisding force-pushed the agent/ws25-voice-server-ws-listener-scope branch from 6789dca to 24374d9 Compare August 7, 2026 03:49
@yisding
yisding merged commit bc36a53 into agent/ws25-voice-server-listener-scope Aug 7, 2026
2 checks passed
@yisding
yisding deleted the agent/ws25-voice-server-ws-listener-scope branch August 7, 2026 04:11
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