Skip to content

Stale child cleanup and non-blocking KVM WebSocket connect#9

Open
nesvet wants to merge 2 commits into
sciapp:masterfrom
nesvet:feat/stale-child-cleanup
Open

Stale child cleanup and non-blocking KVM WebSocket connect#9
nesvet wants to merge 2 commits into
sciapp:masterfrom
nesvet:feat/stale-child-cleanup

Conversation

@nesvet

@nesvet nesvet commented Jun 28, 2026

Copy link
Copy Markdown

Summary

Orphaned nojava-ipmi-kvmrc-* children block noVNC ports after unclean server shutdown.
Long KVM container startup must not block the WebSocket receive loop.

Changes

  • main.py — stale cleanup on startup, SIGTERM, atexit; remove explicit websocket_ping_interval
  • kvm_handler.pycreate_task for connect; _schedule_write for log lines; cancel in-flight connect on close; _safe_write
  • tests/test_kvm_handler_connect.py — connect does not block on_message

Connect work is spawned per tornado#2941.

Requires nojava-ipmi-kvm#38.

Test plan

  • unittest passes
  • Connect succeeds when child startup takes >15s
  • Server restart after session — reconnect without manual docker rm
  • Tab closed during connect — child removed

Tested on ASUS ASMB8-iKVM firmware 1.14.2.

Closes #7

@nesvet nesvet force-pushed the feat/stale-child-cleanup branch from d847b3a to 0668150 Compare June 28, 2026 20:52
@nesvet nesvet force-pushed the feat/stale-child-cleanup branch from 0668150 to 65fcd78 Compare June 28, 2026 21:47
@nesvet nesvet changed the title Remove stale nojava-ipmi-kvmrc containers on server start and shutdown Stale KVM child cleanup and WebSocket connect reliability Jun 28, 2026
Spawn connect work via asyncio.create_task so the WebSocket receive loop
can process control frames during long child startup (tornado#2941).
Schedule log writes on the IOLoop; cancel in-flight connect on close.
Remove explicit websocket_ping_interval. Add connect unittest.
@nesvet nesvet force-pushed the feat/stale-child-cleanup branch from 65fcd78 to 99c58c8 Compare June 28, 2026 22:42
@nesvet nesvet changed the title Stale KVM child cleanup and WebSocket connect reliability Stale child cleanup and non-blocking KVM WebSocket connect Jun 28, 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.

Stale nojava-ipmi-kvmrc containers block noVNC ports after server stop

1 participant