Skip to content

server: own WebSocket manager sweep - #932

Merged
yisding merged 1 commit into
agent/ws25-capacity-gate-task-scopefrom
agent/ws25-websocket-manager-sweep-scope
Aug 7, 2026
Merged

server: own WebSocket manager sweep#932
yisding merged 1 commit into
agent/ws25-capacity-gate-task-scopefrom
agent/ws25-websocket-manager-sweep-scope

Conversation

@yisding

@yisding yisding commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Problem

WebSocketSessionRuntime created its final manager.stop_all() aggregate inside _bounded_cleanup with asyncio.ensure_future. If the force deadline expired, ownership lived only in the grandfathered module-global timeout set rather than on the runtime that initiated the sweep.

Changes

  • add a named cleanup RuntimeTaskScope to WebSocketSessionRuntime
  • create the bounded manager sweep through that scope
  • retain timed-out cancellation-resistant cleanup until it settles
  • release an empty standalone cleanup root after drain
  • add a focused hard-timeout ownership assertion
  • reduce the raw production task baseline from 26 to 25
  • document the runtime-owned final sweep

Why / impact

The hard deadline and cleanup result policy are unchanged. The runtime now has direct, inspectable ownership of its manager sweep and no longer relies solely on the legacy global timeout anchor.

Checks

  • .venv/bin/python -m pytest tests/server/test_websocket_runtime_drain.py -q (17 passed)
  • .venv/bin/python -m pytest tests/server/test_capacity_gate_drain.py tests/server/test_websocket_runtime_drain.py tests/ratchets/test_source_inventory.py -q (89 passed)
  • .venv/bin/ruff check src/easycat/server/transports.py tests/server/test_websocket_runtime_drain.py
  • .venv/bin/ruff format --check src/easycat/server/transports.py tests/server/test_websocket_runtime_drain.py
  • .venv/bin/mypy src/easycat/server/transports.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: c810ee38-cb83-4451-a4ef-fb05508d5659

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-websocket-manager-sweep-scope branch from 9e09177 to a696d24 Compare August 7, 2026 03:15
@yisding
yisding force-pushed the agent/ws25-websocket-manager-sweep-scope branch from a696d24 to db283cd Compare August 7, 2026 03:48
@yisding
yisding merged commit bc36a53 into agent/ws25-voice-server-listener-scope Aug 7, 2026
2 checks passed
@yisding
yisding deleted the agent/ws25-websocket-manager-sweep-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